Local installation of this application consists of the following steps:
Create a new Facebook Application in developers.facebook.com
from the My Apps
menu:
For this script to work, the default settings will do:
Install the code with Composer:
git clone git://github.com/php-earth/stats
cd stats
composer install
The Composer installation script creates app/config/parameters.yaml
file
by asking for configuration parameter values. Configuration parameters are
described in comments in the parameters.yaml.dist.
Provide ID and secret code for your Facebook application, default Graph API version
and other configuration. Configuration is explained in more details in the
configuration chapter.
Run the report generation:
bin/stats generate --from=2016-09-05 --to=2016-09-11
Before generation starts, you must also provide the user access token manually.
You must provide an access token.
Enter user access token from the Graph API Explorer
https://developers.facebook.com/tools/explorer
To generate the user access token, use Graph API explorer and select the application created in step 1.
The only permission required for the application to work is the user_managed_groups
.
If you use Docker you can run this application with the PHP Docker image:
docker run --rm -it -v "$(which composer)":/usr/bin/composer -v "$(pwd)":/usr/src/stats -w /usr/src/stats phpearth/php composer install
docker run --rm -it --name stats -v "$(pwd)":/usr/src/stats -w /usr/src/stats phpearth/php bin/stats generate --from=2017-04-17 --to=2017-04-24