RTG
RTG

Reputation: 1

How to use feedparser to retrieve notifications from Facebook?

I have to show the number of notifications(using the rss feeds) on an external device and thus wanted to retrieve the same using feedparser.

Upvotes: 0

Views: 311

Answers (1)

aerofly5
aerofly5

Reputation: 11

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;

Upvotes: 1

Related Questions