Skip to content

Instantly share code, notes, and snippets.

@scturtle
Created March 19, 2013 13:48
Show Gist options
  • Save scturtle/5196242 to your computer and use it in GitHub Desktop.
Save scturtle/5196242 to your computer and use it in GitHub Desktop.
save feed data from GR
# coding: utf-8
import json
import urllib
import requests
base= 'http://www.google.com/reader/api/0/stream/contents/feed/'
url = 'http://scturtle.me/atom.xml'
url = urllib.quote(url)
get = lambda l: map(json.loads(requests.get(l).content).get,
('items', 'continuation'))
results = []
c = '1'
while c:
items, c = get(base + url + '?c=' + c)
results += items
print len(results)
json.dump(results, open('result.json', 'w'), indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment