Skip to content

Instantly share code, notes, and snippets.

@jachermocilla
Last active August 29, 2015 14:07
Show Gist options
  • Save jachermocilla/464ce2c7dfe567af5862 to your computer and use it in GitHub Desktop.
Save jachermocilla/464ce2c7dfe567af5862 to your computer and use it in GitHub Desktop.
Retrieve posts from "Elbi Files" using Python
"""
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