This project exists because there is a need to generate an automated content calendar for social media publication. With the aim of solving this problem, the project was born with the goal of creating an application that consumes the Notion API to generate a calendar, updated with the current year, considering a list of content types. This project was developed using Node.js
Generating a calendar that defines the content to be published on each day of the week arose as a need when the user tried to use a spreadsheet they had purchased in the past, containing a content planning for social media. However, updating this spreadsheet for the current year would require manual effort from the user, so the creation of an updated calendar generator containing a content plan for social media was considered
- Generate a calendar for the current year in Notion. The calendar should include information about the type of content, social media platforms, and publication date.
- Consume a file containing content recommendations for social media.
- Populate the calendar with content.
To obtain a copy of the project on your local machine, you can make a copy through a clone. Make sure to set up your environment with the tools, languages, and frameworks used.
- Go to https://www.notion.com/my-integrations.
- Click the "+ New integration" button.
- Give your integration a name.
- Select the workspace where you want to install this integration.
- Choose the resources your integration will have access to.
- Click "Send" to create the integration.
- Copy the "Internal Integration Token" on the next page and save it securely, for example, in a password manager.
Initially, integrations do not have access to any pages (or databases) in the workspace. A user must share specific pages with an integration for those pages to be accessed using the API. This helps keep you and your team's information in Notion secure.
Start from a new or existing page in your workspace. Insert a new database by typing "/database" and selecting a "full page" table. Give the table a title. Click the "Share" button and use the selector to find your integration by name and click "Invite."
Your integration now has the requested permissions in the new database. Once an integration is added to a workspace, any member can share pages and databases with that integration—there's no need to be an admin for this step.
Before proceeding, you need the ID of the database you just created. Copy the URL of your Notion database. Ensure you're viewing the database as a full page if you're using an inline database.
If you're using the Notion desktop app, click the "Share" button and select "Copy Link."
The database ID is the part of the URL after your workspace's name (if you have one) and before the question mark (?). The ID has 32 characters, containing numbers and letters. Copy the ID and paste it somewhere you can easily find it later.
Example:
https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|--------- Database ID ----------|
At this point, you need to manually set up the columns in the Notion database. For this project, the following columns were considered:
- Content
- Category
- Social Media
- Date
As a future improvement, it is recommended to extract this information from environment variables.
Set up the .env file as follows:
NOTION_KEY=your_secret
NOTION_DATABASE_ID=your_database_id
Content recommendations are located in the database at "/data/contents.csv." Feel free to add more content if necessary.
To run the application, execute the following command in a terminal:
node index.js
Execute the following command in a terminal:
TO-DO
Please contribute to get details on my process for submitting pull requests.
I use SemVer for version control.
I am Luis Felipe Brum, a Backend developer with experience in information security and integration architecture.
Colaborador | Github |
---|---|
Luis Felipe Brum | atalhox |
🎁 Expressions of Gratitude
- Tell others about this project 📢
- Invite me for a beer 🍺
- Publicly express your gratitude 🤓.