Project Setup and local configuration - Pariks/smallbackendproject GitHub Wiki
Steps to Follow
Files to look for from being in project root
- -index.php //You need to login to fb once to get long lasting access_token
- -cronHourlyFanCount.php //It is the main cron to get fan count from fan page
- -getFans.php //is api file which returns different format json output like, Linechart, table and multiplepage
- -config/config.php //is configuration file where database configuration and fb app is and secret can be set
- -databaseExports/ //has two .sql file to be imported into db
- Note*- Database used here is MySql with Apache server
Here is a simple guide to setup project locally.
- Clone repository
- Import Tables into database from project root
- /databaseExports/fb_hourly_fan_count.sql
- /databaseExports/session.sql
- Setup database connection and update config file from project root
- /config/config.php
- Setup fb_app_id and fb_app_secret Note*- For now you can leave this just to run cron
- Setup crontab to run every 1 hour
- 0 * * * * /{path to /}cronHourlyFanCount.php --uri=CocaCola --page_id=40796308305
or you can run from a command prompt by being in project root type * php cronHourlyFanCount.php --uri=CocaCola --page_id=40796308305
* It will insert into a table with a lastest fan count for fan page CocaCola.
- From browser make request to {localhost}getFans.php?page_id=40796308305&format=linechart to see result in json format Note*- Format can be linechart, table or multiplepage