I have to show the number of notifications(using the rss feeds) on an external device and thus wante开发者_运维百科d to retrieve the same using feedparser.
I'm not sure what you mean by "external device" but the code I used for retrieving notifications is
def getFB(posts, ID, key):
f = feedparser.parse("http://www.facebook.com/feeds/notifications.php?id=" + ID + "&viewer=" + ID + "&key=" + key + "&format=rss20");
print "Here are the latest facebook posts. ";
fi = 0
while fi<posts:
print f.entries[fi].description;
fi = fi + 1;
精彩评论