X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/7f1dd286f4b093c29cde33f42ad4962bd3429675..68b3e2ee0983e0827d5d2600bffa00f47bb12959:/twitter/cmdline.py?ds=sidebyside diff --git a/twitter/cmdline.py b/twitter/cmdline.py index efe95a2..21c26c9 100644 --- a/twitter/cmdline.py +++ b/twitter/cmdline.py @@ -12,7 +12,7 @@ ACTIONS: leave remove the specified user from your following list public get latest public tweets replies get latest replies - search searchtwitter (Beware: octothorpe, escape it) + search search twitter (Beware: octothorpe, escape it) set set your twitter status shell login the twitter shell @@ -52,7 +52,6 @@ prompt: '> OAuth authentication tokens are stored in the file .twitter_oauth in your home directory. - """ CONSUMER_KEY='uS6hO2sV6tDKIOeVjhnFnQ' @@ -73,10 +72,6 @@ from api import Twitter, TwitterError from oauth import OAuth import ansi -# Please don't change this, it was provided by the fine folks at Twitter. -# If you change it, it will not work. -AGENT_STR = "twittercommandlinetoolpy" - OPTIONS = { 'action': 'friends', 'refresh': False, @@ -94,7 +89,7 @@ OPTIONS = { def parse_args(args, options): long_opts = ['help', 'format=', 'refresh', 'oauth=', - 'refresh-rate', 'config', 'length', 'timestamp', + 'refresh-rate=', 'config=', 'length=', 'timestamp', 'datestamp', 'no-ssl'] short_opts = "e:p:f:h?rR:c:l:td" opts, extra_args = getopt(args, short_opts, long_opts) @@ -462,6 +457,9 @@ paste or type it here: webbrowser.open( 'http://api.twitter.com/oauth/authorize?oauth_token=' + oauth_token) + time.sleep(2) # Sometimes the last command can print some + # crap. Wait a bit so it doesn't mess up the next + # prompt. oauth_verifier = raw_input("Please type the PIN: ").strip() twitter = Twitter( auth=OAuth( @@ -473,6 +471,7 @@ paste or type it here: print >> oauth_file, oauth_token print >> oauth_file, oauth_token_secret oauth_file.close() + print print "That's it! Your authorization keys have been written to %s." % ( options['oauth_filename'])