Skip to content

Instantly share code, notes, and snippets.

@RichardLitt
Created November 20, 2012 00:04
Show Gist options
  • Save RichardLitt/4115026 to your computer and use it in GitHub Desktop.
Save RichardLitt/4115026 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import tweepy
CONSUMER_KEY = "..."
CONSUMER_SECRET ="..."
ACCESS_KEY = "..."
ACCESS_SECRET = "..."
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
if len(sys.argv[1]) >= 140:
print 'String too long by %s characters' % str(len(sys.argv[1])-140)
tweet = raw_input('Try again: ')
else:
tweet = sys.argv[1]
api.update_status(tweet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment