Advertisement
praveenks30

fbdata.py

Apr 13th, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import facebook
  2. import json
  3.  
  4. # Just to format Output
  5. def pp(o):
  6. print json.dumps(o, indent=2)
  7.  
  8. # This will always be the first step..
  9. # Use your access token
  10.  
  11. g = facebook.GraphAPI('CAACEdEose0cBAP0dEvKUOIE8rOobx3HbKZBoOqM2F9GT9dBeLeFxinbVm3fEfHXpYcsRIIN9635768SSE1hvZAGsokw5FJsBiEgBW2UOjEaeZA40Hk3VvRibUmctjF2FBAoFVZCcPSAIa5RVB1u6ApazwpsqVgKCqWUJDT4etbWDwjzRYascPZAruTqb4pFBhvYeEanhragZDZD')
  12.  
  13. # Search 5 'Hercules' Pages in facebook
  14.  
  15. print'-----------------------------'
  16. pp(g.request('search',{'q':'Hercules', 'type':'Page' ,'limit':5}))
  17.  
  18. # Get some more information about 'Hercules' movie page
  19.  
  20. print '----------------------------'
  21. pp(g.get_object('677574292288637'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement