diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..6d4057a Binary files /dev/null and b/logo.png differ diff --git a/logo.xcf b/logo.xcf new file mode 100644 index 0000000..b762ee3 Binary files /dev/null and b/logo.xcf differ diff --git a/main.py b/main.py index b4d836a..eda7ca3 100644 --- a/main.py +++ b/main.py @@ -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) diff --git a/tokens_example.py b/tokens_example.py new file mode 100644 index 0000000..3c65e82 --- /dev/null +++ b/tokens_example.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +CONSUMER_KEY = '' +CONSUMER_SECRET = '' + +ACCESS_TOKEN = '' +ACCESS_TOKE_SEARCH = ''