Created
March 19, 2013 13:48
-
-
Save scturtle/5196242 to your computer and use it in GitHub Desktop.
save feed data from GR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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