Download - Facebook fql and tweepy
![Page 2: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/2.jpg)
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" }
![Page 3: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/3.jpg)
FQL = Facebook Query Language http://developers.facebook.com/docs/reference/fql/
![Page 4: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/4.jpg)
FQL = Facebook Query Language
SQL like Easy to Use Graph API
![Page 5: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/5.jpg)
SELECT status_id,message,TIME,SOURCE FROM `status` WHERE uid = me()
Login User Unique ID 112345667889
![Page 6: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/6.jpg)
SELECT [Field] FROM [Table] WHERE [conditions]
Expression
![Page 7: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/7.jpg)
SELECT [Field] FROM [Table] WHERE [conditions]
Expression
Limitation Alawys Need Condtions Field
SELECT [Field] FROM [Table] Error
![Page 8: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/8.jpg)
SELECT link_id, owner, owner_comment, created_time, title, summary, url, image_urls FROM link WHERE link_id = 114961875194024
Expression
![Page 9: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/9.jpg)
.fbconsole.py https://raw.github.com/gist/1194123/fbconsole.py
Python Facebook Library
![Page 10: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/10.jpg)
.fbconsole.py Sample
from urllib import urlretrieve import imp urlretrieve('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
![Page 11: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/11.jpg)
.fbconsole.py Result(JSON)
[{u'post_id': u'100001220342847_269268529764053', u'message': u'\uc81c\uac00 \uc911\ud559\uc0dd \ub54c \uac10\ub3d9 \ubc1b\uc73c\uba74\uc11c \ud588\ub358 \uac8c\uc784..\n\uc9c0\uae08\ub3c4 \uac8c\uc784 \uad00\ub828 \uc77c \ud558\uba74\uc11c \ub2f9\uc2e0\uc774 \uac00\uc7a5 \uac10\uba85\uae4a\uac8c \ud55c \uac8c\uc784\uc774 \ubb34\uc5c7\uc785\ub2c8\uae4c?\n\ub77c\uace0 \ubb3c\uc5b4\ubcfc \ub54c \uc8fc\uc800 \uc5c6\uc774 \ub300\ub2f5\ud558\ub294 \uac8c\uc784..\n\nhttp://itunes.apple.com/us/app/another-world-20th-anniversary/id460076328?mt=8\n\n\uc5b4\ub098\ub354\uc6d4\ub4dc\uac00 20\uc8fc\ub144 \uae30\ub150\ud310\uc774 \ub098\uc654\ub124\uc694, \uceac\ud558\ud558 ^^', u'target_id': None, u'actor_id': 100001220342847, u'comments': {u'count': 1, u'comment_list': [{u'text': u'\uc774\uac74 \uadf8\ub798\ud53d \uc5ec\ubd80\ub97c \ub5a0\ub098\uc11c \uaf2d \uc5d4\ub529\uc744 \ubd10\uc57c \ub428..', u'likes': 0, u'time': 1316830670, u'fromid': 100001220342847, u'id': u'100001220342847_269268529764053_3910464', u'user_likes': False}], u'can_remove': False, u'can_post': True}}]
![Page 12: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/12.jpg)
But, Facebook supports partial
Can’t get Recent Activity
![Page 14: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/14.jpg)
tweepy Sample
import tweepy public_tweets = tweepy.api.public_timeline() for tweet in public_tweets: print tweet.text
![Page 15: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/15.jpg)
Need Twitter Access Token
For OAuth
![Page 17: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/17.jpg)
Create Twitter Access Token
![Page 18: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/18.jpg)
Create Twitter Access Token
![Page 19: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/19.jpg)
Support API List For Timeline http://code.google.com/p/tweepy/wiki/APIReference
Timeline
Public_timeline Returns the 20 most recent public statuses
Home_timeline Returns the statuses of user and friends with retweets
Friends_timeline Returns the statuses of user and friends
User_timeline Returns the statuses of the user
Mentions Returns the mentions of the user
Retweeted_by_me Returns the retweets posted by the user
Retweeted_to_me Returns the retweets posted by the user's friends
Retweets_of_me Returns the tweets of the authenticated user that have been retweeted by others
![Page 20: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/20.jpg)
DEMO
![Page 21: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/21.jpg)
Q&A
![Page 22: Facebook fql and tweepy](https://reader034.vdocument.in/reader034/viewer/2022051817/548408b2b47959f60c8b4af7/html5/thumbnails/22.jpg)
Thank you!