A simple Instagram analytics tool that continuously logs and graphs your follower count.
SSH into server, cd
to the public root and clone project.
git clone https://github.com/josephfusco/ig-follow-count .
Copy config-sample.php
to config.php
in the project root and fill in the values.
cp config-sample.php config.php && nano config.php
Replace the text within the brackets along with the brackets with the proper values. To learn more about how to attain these values visit https://www.instagram.com/developer/authentication/.
/** Instagram user ID */
define( 'IG_USER_ID', '{your user id here}' );
/** Instagram access token */
define( 'IG_ACCESS_TOKEN', '{your access token here}' );
After saving the newly made config.php
, we just need to set the cron job.
crontab -e
In this example we are running cron.php
every minute which is located in the project root. Add the following to the file and save. (replace '{yourwebsite.com}' with your domain)
*/1 * * * * wget -O /dev/null http://{yourwebsite.com}/cron.php
Upon saving the file it should confirm with the following message: crontab: installing new crontab
.
Sample data will keep being displayed until cron.php
is first ran. Once ran it will initially create the log.csv
file and the sample data will stop loading.
Time,Grams,Followers,Following
* Grams represents the number of photos on your account at the time
- Create simple theme template system.
- Add pre-loader.
- Create install script for easier setup.
- Possibly break up log files into months or weeks for shorter graph load times.
- Live update graph.