vendredi 17 avril 2015

Facebook login - user token

I'm trying to make a Windows application which can post into facebook groups. Posting is not a problem, the problem is, that I have to get user_token each time I want to use it. Is there a way how to get user_token with permissions like group_posts etc. automatially?


Here is a simple cut of my code:



import facebook

oauth_access_token = 'MY USER ACCESS TOKEN'
graph = facebook.GraphAPI(oauth_access_token)
groups = graph.get_object("me/groups")
group_id = groups['data'][1]['id'] # this code posts text "The post." into one group
print groups['data'][1]['name']

graph.put_object(group_id, "feed", message="The post.")


It would be good if there was a form with login and password, and after filling those forms, the program would obtain user_token.


Is it possible? If yes, could you give me an advice?


Aucun commentaire:

Enregistrer un commentaire