I’m working on an idea I had for our clients at work to be able to publish elements to their Facebook page wall in advance. That allows them to push articles and status updates once, while a CRON job would do the actual work with posting to the wall.
I’ve read about the offline_access deprecation in the Facebook API, and that you now get an extended long-lived access code. However, I’m not quite sure how I could use the access code to run a CRON job every now and then.
Does anyone have a clue on how to login and post to Facebook page as a CRON job?
What you can do it create a page where the client can “schedule” all their post on. When they access the website, ask them to login to facebook where you can get a
access_tokenfor use in cron.Follow the Offline Access Guide to get a long-lived access token for this purpose. This will let you get a long-lived
access_tokenfor Page access too. You will need to use the long-lived pageaccess_tokenin the cron to publish the scheduled posts – that bit is the same as making a regular API call, but using a page access token instead.