This is a simple PHP script streaming Notion database items/pages with a date into the iCalendar format.
- PHP ^8.1
- Composer
Install dependencies through composer.
composer install
Create an .env file from the example, and set up the variables explained below.
cp .env.example .env
Set up a Notion integration to receive an API key.
The iCal feed will be accessible through https://www.yourdomain.com/index.php?k=<SECRET_KEY>
.
Make sure you add the key in the 'k' GET variable.
To run this script, you will need to add the following environment variables to your .env file
DEBUG_MODE
Debugging mode (prints content if true)
SECRET_KEY
Security key preventing public access
NOTION_API_KEY
Notion API key
NOTION_DB_ID
Notion database ID
NOTION_DATE_PROPERTY_NAME
Notion property name containing the task date
NOTION_STATUS_PROPERTY_NAME
Notion property name containing the status
NOTION_EXCLUDE_STATUS
Notion status to exclude in the iCal feed
TTL
Suggested update frequency for clients in ISO 8601 format
Can be found here