Giter Site home page Giter Site logo

notionautomation's Introduction

Notion Automation using Serverless and Notion API

Hey, Subho this side, I created this project. You can freely use this to automate your blog posts to DevTo. More integrations will come soon. And if you want you can defnitely contribute to this. Plan is to automate for all the blogging platforms.

How to setup Local Environment

Step 1

Install all dependencies :accessibility:

npm install

npm install -g serverless

serverless config credentials --provider aws --key <YOUR_USER_KEY> --secret <YOUR_USER_SECRET>

Step 2

Add Environment Variables. There is only two variables required to make this work. You already have a .env.local file in your root directory if you have done the Step 1 properly.

NOTION_API_KEY=
DEV_TO_API_KEY=
NOTION_DATABASE_ID=

Getting the env. ๐Ÿ”

Head to Notion's Integration Website. Make a new integration and get the secret key from there. That is your NOTION_TOKEN.

Finally it's time to get the NOTION_DATABASE_ID

See the URL of the page. For example https://www.notion.so/XYZ/ContentCurator-cd0db9f8767843ca9563c591a233be5b. Here cd0db9f8767843ca9563c591a233be5b is the database id.

Step 3

Add Environment Variables in serverless.yml file. If you want, you can play around with the scheduler and make your lambda function check every X minutes whether you are done with your blogs or not.

NOTION_API_KEY: 
DEV_TO_API_KEY: 
NOTION_DATABASE_ID: 

Step 4 ๐Ÿค

Making Blogs database in notion.

For the next env. Make a new page in Notion and make a new database in that.

Add these three column there

Title
Description
Cover Image URL
Tags
Status
ID

Here is a screenshot of the table and the propery names. โฌ‡๏ธ image

Make sure to name them exactly this. And DON'T FORGET to add a Published status. But initally it should have status Not started or In progress. Once you're done writing the blog, change your status to done. It will automatically get changed to status published and keep track of your post updates every 10 mins.

Now it is time to connect the page to the Developers App you just built.

Go to Shares of the page and scroll down until you find Connections . Click on Add connections and add your developer app.

Here is a screenshot of where you can find the connections. And then you can add your app you made in this website Notion's Integration Website โฌ‡๏ธ

image

Step 5 ๐Ÿƒ

When all is set, deploy your lambda and check using...

npm run deploy

And boom!

Now start writing blogs on Notion and it will work magically.

Star this if you find it useful.


Want to contribute to the repo to make it better?? ๐Ÿ”ฅ

Yup! Everyone is welcome to cohntribute to this repo and making this better day by day. This could be a small typo fix, design fix to adding some big functionality like adding hashnode and other integrations.

notionautomation's People

Contributors

ighoshsubho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

itsbrex

notionautomation's Issues

Hashnode Integration Needed

  • Make a function that takes all the formatted responses from notion API and pushes it to createHashnodeBlog function
  • Make proper mutation and add docs for the same

Medium Integration Needed

  • Make a function that takes all the formatted responses from notion API and pushes it to createMediumBlog function
  • Make proper mutation and add docs for the same

Code Needs to Get Structured

  • Make separate folders where needed
  • Added proper docs for the same like about the file and folder structure
  • Again add proper CONTRIBUTING.md and DOCUMENTATION.md guidelines

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.