Last active
August 29, 2015 14:06
-
-
Save aoshiman/4725d9a903f4af88a761 to your computer and use it in GitHub Desktop.
Tweet via Twython(Python3.4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
from twython import Twython, TwythonError | |
from pit import Pit | |
def main(post): | |
"""Function for OAuth Setting and Tweet""" | |
oauth_conf = Pit.get('oauth_conf') | |
access_conf = Pit.get('access_conf') | |
twitter = Twython( | |
oauth_conf['consumer_key'], | |
oauth_conf['consumer_secret'], | |
access_conf['access_token'], | |
access_conf['access_secret'] | |
) | |
try: | |
twitter.update_status(status = post) | |
except TwythonError as e: | |
print(e) | |
if __name__ == '__main__': | |
main(' '.join(sys.argv[1:])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment