I hope somebody can help work out to do this. Basically, I have a php script which displays youtube videos and statistics from the youtube data json api. The thing is, I need to be able to show the total view count for the previous month as well as the current month. I can get the total view count for a video and if you look on youtube there is a graph underneath the video which shows the views for a few months. Is this possible?? If not, can is there any other way I could go about storing the previous months view count?
Thanks in advance.
Run a cron job that updates a monthly tick…
All you would need to do is store the value of views at the beginning of each month and when the next month arrives you calculate the difference.
Running the cron job would ensure that 30 days are up and that the values should be updated.
Ex.