Skip to content

Instantly share code, notes, and snippets.

@mdeous
Created June 2, 2011 14:15
Show Gist options
  • Save mdeous/1004527 to your computer and use it in GitHub Desktop.
Save mdeous/1004527 to your computer and use it in GitHub Desktop.
scoopy usage sample
import os
import webbrowser
token_file = 'token.pickle' # optional
api = ScoopItAPI(
'consumer key',
'consumer secret'
)
if os.path.exists(token_file):
api.load_oauth_token(token_file) #optional
else:
# get OAuth access token
api.get_oauth_request_token()
# send the user to scoop.it app authorization page (and get the verifier in the query made to redirect page)
webbrowser.open(api.get_oauth_access_token_url('http://localhost'))
api.get_oauth_access_token(raw_input('Verifier: '))
api.save_oauth_token(token_file) # optional
profile = api.get_profile()
for topic in profile.curatedTopics:
print "Topic: ", topic.name
print "> ", topic.description
for post in topic.curatedTopics:
print " Post: ", post.title
print " > ", post.content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment