Search code examples
facebookweb-scrapingdocumentfacebook-group

Scrape a Facebook Group Document


background: My friend has a minecraft server with a white list. The community for that server is managed with a facebook group, and the white list is a facebook document within that group.

Currently the whitelist is managed manually from the facebook document, and we would like to automate the process, ie. run a script that automatically reads the document and generates a new white list

so far ive figured out that us can use the graph api and do a GET for https://graph.facebook.com/<doc-id>?access_token=...

and i was able to see the json object using the explorer tool

but the access token only seems to be valid for one user for one session, which means i would somehow have to provide my username/password and get a new access_token every time. that's the part where i'm not sure what to do.


Solution

  • Actually no, you can register you own Facebook app https://developers.facebook.com/apps and get an access token from the url

    https://graph.facebook.com/oauth/access_token?client_id=ID&client_secret=SECRET&grant_type=client_credentials

    Then, you can use this token for requests.