A tool to generate random combined emojis and automate emoji assignment for Notion pages using the Emoji Kitchen API, Notion, Make and Vercel
- 🎲 Generate a random emoji and save it to a file.
- 📄 Create new Notion pages from the command line.
- 🔄 Automate emoji assignment for Notion pages via Make.com & Vercel.
-
Clone this repo
-
Install dependencies
- Run
yarn install
- Run
-
Set up environment variables
- Use
.env.exampleas reference NOTION_KEYis your notion integration key. For more information please refer to the docs at https://developers.notion.com/docs/create-a-notion-integrationNOTION_DATABASE_IDis the id of the database where you will add new pages to. More info at http://developers.notion.com/reference/retrieve-a-databaseAPI_SECRET_KEYis a random secret you need to set locally and on Vercel when you deploy the API
- Use
- Run
node scrape-emoji.jsfromclientfolder - The new emoji is saved in the output folder as
.png
- Run
node notion-page-generator.js --title="Your page title" --content="Some content"fromclientfolder to add a new page to your selected database. It comes with a random combined emoji!
To automate adding emojis to created & updated pages on Notion using Make
-
Create a New Vercel Project from command line.
yarn run verceland create a new project. -
On Vercel dashboard, select your new project, navigate to settings and set the environment variables
-
From a terminal, run
yarn run vercel:deployto deploy your project -
To test your integration locally, run
yarn run vercel:devto start a local server. Make a cURL request to Vercel's local servercurl -X POST "http://localhost:3000/api/update-page" \ -H "Content-Type: application/json" \ -H "api-secret-key: api-secret-key" \ --data '{"pageId": "a-notion-page-id"}'Watch the page on Notion as it gets its new look
-
To automate the process, go to Make and log in.
-
Click "Create a new scenario".
-
Click "Add Module" and select Notion. Select --> Watch Database Items.
-
Set up Notion and Http request modules.
You can watch items on create or update. I have created two scenarios to watch both so a created or updated page with no emiji gets the update
