from twython import Twython
import glob
import random
import time
app_key = "IL2cl4l0utXc1aStFKvZNkS0F"
app_secret = "JtGkcWmyzQDWVpiVeM9mFUWSAYqjAux4z6p4qUVoSVuLuJlFps"
oauth_token = "1206083934603431936-fZ9vf2mVrNaIW04DoPBKMcb3Vcd1Op"
oauth_token_secret = "TSlorK1nYa9LYfA2UIgvObX4tv9m50kKv2o2H4abhWQPY"
twitter = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
while True:
seconds = time.time()
tweettime = time.ctime (seconds)
photo = open('/var/www/html/eu001.png', 'rb')
response = twitter.upload_media(media=photo)
textfilecontent = open ('/var/www/html/eurocount.log')
text = ' ituenix.de statistics ' + textfilecontent.read ()
twitter.update_status(status=tweettime + text, media_ids=[response['media_id']])
textfilecontent = open ('/var/www/html/eurocount2.log')
text = ' ituenix.de statistics ' + textfilecontent.read ()
twitter.update_status(status=tweettime + text)
time.sleep(3600*4)