Skip to content

Instantly share code, notes, and snippets.

@aoshiman
Created June 28, 2013 12:33
Show Gist options
  • Save aoshiman/5884339 to your computer and use it in GitHub Desktop.
Save aoshiman/5884339 to your computer and use it in GitHub Desktop.
Tweet via CUI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tweepy import API, OAuthHandler
from pit import Pit
def main(post):
"""Function for OAuth Setting and Tweet"""
cconf = Pit.get('oauth_conf')
auth = OAuthHandler(cconf['consumer_key'], cconf['consumer_secret'])
aconf = Pit.get('access_aoshiman')
auth.set_access_token(aconf['access_token'], aconf['access_secret'])
api = API(auth)
#print post
api.update_status(post)
if __name__ == '__main__':
import sys
main(unicode(' '.join(sys.argv[1:]), 'utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment