Facebook FQL And Tweepy             charsyam@naver.com
Facebook Graph API(Json)http://developers.facebook.com/docs/reference/api/ { "name": "Facebook Platform", "type": "page", ...
FQL = Facebook Query Languagehttp://developers.facebook.com/docs/reference/fql/
FQL = Facebook Query Language         SQL like         Easy to Use Graph API
SELECT status_id,message,TIME,SOURCE FROM`status` WHERE uid = me()                                Login User Unique ID    ...
ExpressionSELECT [Field] FROM [Table] WHERE [conditions]
ExpressionSELECT [Field] FROM [Table] WHERE [conditions]SELECT [Field] FROM [Table]  ErrorLimitationAlawys Need Condtions...
ExpressionSELECT link_id, owner, owner_comment, created_time, title,summary, url, image_urls FROM link WHERE link_id =1149...
.fbconsole.pyhttps://raw.github.com/gist/1194123/fbconsole.pyPython Facebook Library
.fbconsole.py Samplefrom urllib import urlretrieveimport impurlretrieve(https://raw.github.com/gist/1194123/fbconsole.py, ...
.fbconsole.py Result(JSON)[{upost_id: u100001220342847_269268529764053, umessage: uuc81cuac00uc911ud559uc0dd ub54c uac10ub...
But, Facebook supports partial     Can’t get Recent Activity
tweepyhttp://code.google.com/p/tweepy/Python Twitter Library
tweepy Sampleimport tweepypublic_tweets = tweepy.api.public_timeline()for tweet in public_tweets:   print tweet.text
Need Twitter Access Token    For OAuth
Go https://dev.twitter.com/apps
Create Twitter Access Token
Create Twitter Access Token
Support API List For Timelinehttp://code.google.com/p/tweepy/wiki/APIReferenceTimelinePublic_timeline    Returns the 20 mo...
DEMO
Q&A
Thank you!
Upcoming SlideShare
Loading in...5
×

Facebook fql and tweepy

1,278

Published on

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,278
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Facebook fql and tweepy

  1. 1. Facebook FQL And Tweepy charsyam@naver.com
  2. 2. Facebook Graph API(Json)http://developers.facebook.com/docs/reference/api/ { "name": "Facebook Platform", "type": "page", "website": "http://developers.facebook.com", "username": "platform", "founded": "May 2007", "company_overview": "Facebook Platform enables anyone to build...", "mission": "To make the web more open and social.", "products": "Facebook Application Programming Interface (API)...", "likes": 449921, "id": 19292868552, "category": "Technology" }
  3. 3. FQL = Facebook Query Languagehttp://developers.facebook.com/docs/reference/fql/
  4. 4. FQL = Facebook Query Language SQL like Easy to Use Graph API
  5. 5. SELECT status_id,message,TIME,SOURCE FROM`status` WHERE uid = me() Login User Unique ID 112345667889
  6. 6. ExpressionSELECT [Field] FROM [Table] WHERE [conditions]
  7. 7. ExpressionSELECT [Field] FROM [Table] WHERE [conditions]SELECT [Field] FROM [Table]  ErrorLimitationAlawys Need Condtions Field
  8. 8. ExpressionSELECT link_id, owner, owner_comment, created_time, title,summary, url, image_urls FROM link WHERE link_id =114961875194024
  9. 9. .fbconsole.pyhttps://raw.github.com/gist/1194123/fbconsole.pyPython Facebook Library
  10. 10. .fbconsole.py Samplefrom urllib import urlretrieveimport impurlretrieve(https://raw.github.com/gist/1194123/fbconsole.py, .fbconsole.py)fb = imp.load_source(fb, .fbconsole.py)fb.AUTH_SCOPE = [read_stream]fb.authenticate()comments = fb.fql("SELECT post_id, actor_id, target_id, message, comments FROM stream WHERE filter_key in(SELECT filter_key FROM stream_filter WHERE uid=me() AND type=newsfeed) AND is_hidden =0 LIMIT 1“)print comments
  11. 11. .fbconsole.py Result(JSON)[{upost_id: u100001220342847_269268529764053, umessage: uuc81cuac00uc911ud559uc0dd ub54c uac10ub3d9 ubc1buc73cuba74uc11c ud588ub358uac8cuc784..nuc9c0uae08ub3c4 uac8cuc784 uad00ub828 uc77cud558uba74uc11c ub2f9uc2e0uc774 uac00uc7a5 uac10uba85uae4auac8c ud55cuac8cuc784uc774 ubb34uc5c7uc785ub2c8uae4c?nub77cuace0ubb3cuc5b4ubcfc ub54c uc8fcuc800 uc5c6uc774 ub300ub2f5ud558ub294uac8cuc784..nnhttp://itunes.apple.com/us/app/another-world-20th-anniversary/id460076328?mt=8nnuc5b4ub098ub354uc6d4ub4dcuac00 20uc8fcub144uae30ub150ud310uc774 ub098uc654ub124uc694, uceacud558ud558 ^^, utarget_id:None, uactor_id: 100001220342847, ucomments: {ucount: 1, ucomment_list: [{utext:uuc774uac74 uadf8ub798ud53d uc5ecubd80ub97c ub5a0ub098uc11c uaf2duc5d4ub529uc744 ubd10uc57c ub428.., ulikes: 0, utime: 1316830670, ufromid:100001220342847, uid: u100001220342847_269268529764053_3910464, uuser_likes: False}],ucan_remove: False, ucan_post: True}}]
  12. 12. But, Facebook supports partial Can’t get Recent Activity
  13. 13. tweepyhttp://code.google.com/p/tweepy/Python Twitter Library
  14. 14. tweepy Sampleimport tweepypublic_tweets = tweepy.api.public_timeline()for tweet in public_tweets: print tweet.text
  15. 15. Need Twitter Access Token For OAuth
  16. 16. Go https://dev.twitter.com/apps
  17. 17. Create Twitter Access Token
  18. 18. Create Twitter Access Token
  19. 19. Support API List For Timelinehttp://code.google.com/p/tweepy/wiki/APIReferenceTimelinePublic_timeline Returns the 20 most recent public statusesHome_timeline Returns the statuses of user and friends with retweetsFriends_timeline Returns the statuses of user and friendsUser_timeline Returns the statuses of the userMentions Returns the mentions of the userRetweeted_by_me Returns the retweets posted by the userRetweeted_to_me Returns the retweets posted by the users friendsRetweets_of_me Returns the tweets of the authenticated user that have been retweeted by others
  20. 20. DEMO
  21. 21. Q&A
  22. 22. Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×