Facebook fql and tweepy
Upcoming SlideShare
Loading in...5
×
 

Facebook fql and tweepy

on

  • 1,871 views

 

Statistics

Views

Total Views
1,871
Views on SlideShare
1,871
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Facebook fql and tweepy Facebook fql and tweepy Presentation Transcript

  • Facebook FQL And Tweepy charsyam@naver.com
  • 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" }
  • 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 112345667889
  • ExpressionSELECT [Field] FROM [Table] WHERE [conditions]
  • ExpressionSELECT [Field] FROM [Table] WHERE [conditions]SELECT [Field] FROM [Table]  ErrorLimitationAlawys Need Condtions Field
  • ExpressionSELECT link_id, owner, owner_comment, created_time, title,summary, url, image_urls FROM link WHERE link_id =114961875194024
  • .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)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
  • .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}}]
  • 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 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
  • DEMO
  • Q&A
  • Thank you!