A simple python application to scrape a Facebook page and collect insights about the posts on the page.
- Create a virtual environment for the project:
mkvirtualenv scrapy-insights
- Install requirements:
pip install requirements.txt
You will need a Facebook access token with the read_insights
and manage_pages
permissions, as well as the Facebook
Page ID (found via Page > Settings > Page Info > Facebook Page ID
).
Then, just run this command:
scrapy crawl page -a page=<PAGE_ID> -a token=<PAGE_TOKEN>
Then, insights for that pages posts will be collected and sent to RabbitMQ.
RabbitMQ configuration can be found in insights/settings.py
.
Due to time constraints, the following features have been omitted
- Tests
- Handling Facebook Pagination