#!/usr/bin/python2
# -*- coding: utf-8 -*-
from twython import Twython
import tweepy
APP_KEY = "IL2cl4l0utXc1aStFKvZNkS0F"
APP_SECRET = "JtGkcWmyzQDWVpiVeM9mFUWSAYqjAux4z6p4qUVoSVuLuJlFps"
OAUTH_TOKEN = "1206083934603431936-fZ9vf2mVrNaIW04DoPBKMcb3Vcd1Op"
OAUTH_TOKEN_SECRET="TSlorK1nYa9LYfA2UIgvObX4tv9m50kKv2o2H4abhWQPY"
import tweepy
# Authenticate to Twitter
auth = tweepy.OAuthHandler(APP_KEY, APP_SECRET)
auth.set_access_token(OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
# Create API object
api = tweepy.API(auth, wait_on_rate_limit=True)
timeline = api.user_timeline()
for tweet in timeline:
print(f"{tweet.text}")
if tweet.text.find("PLOT:", 0, len("PLOT:"))!=-1:
datei = open('./compiler.txt','w')
datei.write(f"{tweet.text}")
break
elif tweet.text.find("PLOT:")!=-1:
datei = open('./compiler.txt','w')
datei.write(f"{tweet.text}")
break