Skip to content

Instantly share code, notes, and snippets.

@jaredlewis
Created March 15, 2013 01:44
Show Gist options
  • Save jaredlewis/5166890 to your computer and use it in GitHub Desktop.
Save jaredlewis/5166890 to your computer and use it in GitHub Desktop.
# Get the stories from source proxies
stories = []
source_stream_url = settings.SOURCEPROXIES_API + "/sources/stream"
source_stream_params = {
"source_uuids": ",".join([str(source_uuid) for source_uuid in source_uuids]),
"offset": offset,
"num_stories": num_stories,
"older_than": older_than,
"newer_than": newer_than,
"exclude_id_list": exclude_id_list
}
source_stream_response = requests.post(source_stream_url, params=source_stream_params)
if source_stream_response.status_code == requests.codes.ok:
stories = source_stream_response.json.get('data', {
'stories': []
}).get('stories')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment