aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README7
-rw-r--r--googlereader.py23
2 files changed, 18 insertions, 12 deletions
diff --git a/README b/README
index 96a718c..4826fc3 100644
--- a/README
+++ b/README
@@ -1 +1,6 @@
-Depends on requests
+Dependencies:
+* Requests http://python-requests.org/
+* BeautifulSoup http://www.crummy.com/software/BeautifulSoup/
+
+pip install beautifulsoup4
+pip install requests
diff --git a/googlereader.py b/googlereader.py
index d152b98..dd5d472 100644
--- a/googlereader.py
+++ b/googlereader.py
@@ -25,21 +25,22 @@ class Feeder:
"""generator which returns feed entries one by one.
it seems that google caps the n parameter to 1000 so
we have to use the continuation parameter"""
- r = requests.get(self.FEED_URL+url,headers = self.headers)
+ r = requests.get(self.FEED_URL+url,
+ headers = self.headers)
soup = BeautifulSoup(r.text)
for entry in soup("entry"):
yield entry
- while soup.find("gr:continuation") is not None:
- params = {"c": soup.find("gr:continuation").string}
- r = requests.get(self.FEED_URL+url,
- params = params,
- headers = self.headers)
- soup = BeautifulSoup(r.text)
- for entry in soup("entry"):
- yield entry
+ while soup.find("gr:continuation") is not None:
+ params = { "c": soup.find("gr:continuation").string }
+ r = requests.get(self.FEED_URL + url,
+ params = params,
+ headers = self.headers)
+ soup = BeautifulSoup(r.text)
+ for entry in soup("entry"):
+ yield entry
-if __name__=="__main__":
+if __name__ == "__main__":
import sys
- feeder = Feeder(sys.argv[1],sys.argv[2])
+ feeder = Feeder(sys.argv[1], sys.argv[2])
for entry in feeder.getFeed("http://planetkde.org/rss20.xml"):
print entry.published.string, entry.title.string