Last active
August 29, 2015 14:07
-
-
Save jachermocilla/464ce2c7dfe567af5862 to your computer and use it in GitHub Desktop.
Retrieve posts from "Elbi Files" using Python
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
""" | |
based on : <https://gist.github.com/mylsb/10294040> | |
""" | |
import facebook | |
import requests | |
def some_action(post): | |
print post['message'] | |
print "----------------------------------------------------" | |
access_token = '<your access token>' | |
graph = facebook.GraphAPI(access_token) | |
posts = graph.get_connections('uplbconfessions', 'posts',limit=15) | |
while True: | |
try: | |
[some_action(post=post) for post in posts['data']] | |
posts = requests.get(posts['paging']['next']).json() | |
except KeyError: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment