Implemented the actual tweeting

Added a logo
This commit is contained in:
Sebastian 2016-04-05 22:34:42 +02:00
parent 8364afe999
commit 09868227db
4 changed files with 23 additions and 2 deletions

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

BIN
logo.xcf Normal file

Binary file not shown.

17
main.py
View File

@ -1,12 +1,25 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import tweepy
from tokens import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKE_SEARCH
from rss import get_new_items
from photos import get_random_photo
def setup_api():
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKE_SEARCH)
return tweepy.API(auth)
api = setup_api()
new_items = get_new_items()
if new_items != []:
print new_items
for item in new_items:
api.update_status(item)
else:
print get_random_photo()
status = get_random_photo()
api.update_with_media('photo.jpg', status=status)

8
tokens_example.py Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKE_SEARCH = ''