Can be used to get Posts and Comments using FB API. Integrate fb_token_generator to get new access token every hour and use it to get fb data continously without having to manually replace token.
To run the code, setup using following commands in a terminal(Linux/Mac)**
git clone https://github.com/scottydelta/fb_data_scraper.gitcd fb_data_scrapervirtualenv .envsource .env/bin/activatecd srcpip install -r requirements
**Assuming that PostgreSQL, pip and virtualenv are installed.
- Edit the
settings.pyand add/change the DB URI(DB name) or db user or password for Postgres. - Get ACCESS_TOKEN from Facebook and insert in the
settings.py. - Add the list of pages you want to scrape.
- Execute
python manage.py createdbto create the tables and initialize the tables** - Execute
python fb_data.pyto execute the script to get posts and comments from a page.
**Assuming the Database is already created in Postgres