Under the normal authentication flow you get a user token and a refresh token
You can use the refresh token to get a new access token when the access token expires. (Then store the new access and refresh tokens)
A refresh token doesn’t have an expiration but maybe become invalid for another reason requiring you to get a new access and refresh token key set again manually
Becuase you need to modify the code to do what you need it to do
The PHP Example
Stores the generated token in $_SESSION you need to modify the script to do what you need it to do.
It’s an exmaple script to demonstrate how you can authenticate and obtain a token in PHP.
So you could change this script to generate a token and store it in a DB for your Cron Scripts to collect your sub/follow count/etc for display on your website
So take the script and adjust it accordingly to meet your needs.