Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're open to trying another library, you could give <a href="https://github.com/litl/rauth">rauth</a> a shot. There's already <a href="https://github.com/litl/rauth/blob/master/examples/twitter-timeline-cli.py">a Twitter example</a> but if you're feeling lazy and just want a working example, here's how I'd modify that demo script:</p> <pre><code>from rauth import OAuth1Service # Get a real consumer key &amp; secret from https://dev.twitter.com/apps/new twitter = OAuth1Service( name='twitter', consumer_key='J8MoJG4bQ9gcmGh8H7XhMg', consumer_secret='7WAscbSy65GmiVOvMU5EBYn5z80fhQkcFWSLMJJu4', request_token_url='https://api.twitter.com/oauth/request_token', access_token_url='https://api.twitter.com/oauth/access_token', authorize_url='https://api.twitter.com/oauth/authorize', base_url='https://api.twitter.com/1/') request_token, request_token_secret = twitter.get_request_token() authorize_url = twitter.get_authorize_url(request_token) print 'Visit this URL in your browser: ' + authorize_url pin = raw_input('Enter PIN from browser: ') session = twitter.get_auth_session(request_token, request_token_secret, method='POST', data={'oauth_verifier': pin}) params = {'screen_name': 'github', # User to pull Tweets from 'include_rts': 1, # Include retweets 'count': 10} # 10 tweets r = session.get('statuses/user_timeline.json', params=params) for i, tweet in enumerate(r.json(), 1): handle = tweet['user']['screen_name'].encode('utf-8') text = tweet['text'].encode('utf-8') print '{0}. @{1} - {2}'.format(i, handle, text) </code></pre> <p>You can run this as-is, but be sure to update the credentials! These are meant for demo purposes only.</p> <p>Full disclosure, I am the maintainer of rauth.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload