Reputation: 722
I need to check if my users liked or posted to pages. I've tried a few of the packages around (facebook_api, django-facebook) but cannot seem to login using my access_token, or get an fql request working.
This will be a cron job, not a page load. The user will not be logged in.
Does anyone have any ideas?
Upvotes: 0
Views: 602
Reputation: 3155
I'm the author of Django Facebook, this is how you could do it:
Implement a registration flow, have a look at the docs. https://github.com/tschellenbach/Django-facebook
Now that your users can register the database will contain the access_token and facebook id for the users. In your cronjob you can do things like:
from open_facebook.api import OpenFacebook
graph = OpenFacebook(access_token)
graph.get('%s/likes' % facebook_id)
graph.fql('SELECT ... FROM like WHERE post_id = A and user_id = B')
for a cronjob i would use graph.batch_fql(dictionary_with_queries) for better performance
Upvotes: 1