Create Kirby content from facebook events

How to create Kirby content from Facebook events?

A client wants to be able to automate the creation of a page inside his kirby website when he creates a facebook event. Do you think it could be done? How?


I have never done that, but the Facebook Graph API could be a good starting point.

yes, and the part related to events is here:

But how do you think we could automate the importation of this events on the Kirby side?

The simplest way would be to use a Cronjob that runs every few hours. If you need to create the Kirby page instantly, you could alternatively create a Panel widget with a button that manually runs the script to fetch the events.

Ok thanks @lukasbestle
So a cronJob can use the facebook api and create a text file to populate kirby?
Is that it?

Well, no. A Cronjob can only call an arbitrary script. You need to develop that script of course.

ok I understand.
a php script using facebook API is called by the cron job and creates Kirby content.
Thanks a lot


One hint: The script can use the $pages->create() method, which will create the pages for you.