This project is intended to move items from a Ghost API to Apple News.
You must first initialise the database by executing:
php src/init_sqlite_db.php
This will create the tables and system parameter that is used by the sync process.
You will then need to update the Config.php file to include your Ghost and Apple News Key and Secrets. View the file for more info.
To run the sync process, just execute:
php src/sync.php
sync.php contains all the code that does the following:
- Retrieve all records from the specified Ghost API
- For each record check if it already exists in our SQLite database
- If it is still updated, move on to the next item
- Determine if we need to Post this article as a new one or update an existing article in Apple News and do the appropriate action.
- Create/update our database record for the article ID and revision ID
Log files are placed under <dir>/logs with the format:
synclog-<sync_dt>-<last_sync_dt>.log
Where:
- sync_dt = The current date (the sync date)
- last_sync_dt = The value stored in the database for when there was a successful sync
Only errors are logged at the moment.