def facebook_auth(): F.AUTH_SCOPE = [ 'publish_stream', 'read_stream', 'user_status', 'offline_access' ] short_token = F.authenticate() params = { 'client_id': F.APP_ID, 'grant_type': 'fb_exchange_token', 'fb_exchange_token': short_token } return F.graph_post('/oauth/access_token', params)
def facebook_post_feed(post, access_token): F.ACCESS_TOKEN = access_token F.graph_post('/me/feed', {'message': post})
def facebook_comment_post(post_id, comment, access_token): post_url = '/' + post_id + '/comments/' params = {'access_token': access_token, 'message': comment} F.graph_post(post_url, params)
def facebook_like_post(post_id, access_token): post_url = '/' + post_id + '/likes/' params = {'access_token': access_token} F.graph_post(post_url, params)
def facebook_comment_post(post_id, comment, access_token): post_url = '/' + post_id + '/comments/' params = {'access_token' : access_token, 'message' : comment} F.graph_post(post_url, params)
def facebook_like_post(post_id, access_token): post_url = '/' + post_id + '/likes/' params = {'access_token' : access_token} F.graph_post(post_url, params)
def facebook_auth(): F.AUTH_SCOPE = ['publish_stream', 'read_stream', 'user_status', 'offline_access'] short_token = F.authenticate() params = {'client_id' : F.APP_ID, 'grant_type' : 'fb_exchange_token', 'fb_exchange_token' : short_token} return F.graph_post('/oauth/access_token', params)