Code Monkey home page Code Monkey logo

notion_import_japanese_holidays's Introduction

Notion に日本の祝日をインポート

Node.js スクリプトを利用し、Notion のデータベースに新しいページ(祝日)を追加することができます。

環境

使い方

  1. Getting started に従って以下の手順をを実行し、Notion の統合を作成する

    • Create your integration in Notion
    • Get your API secret
    • Give your integration page permissions
  2. リポジトリを clone し、依存関係をインストールする

    npm install
  3. .env.example をコピーし、.env を作成する

    • NOTION_KEY:新しく作成した統合の API キー
    • NOTION_PAGE_ID:データベースが存在する Notion ページの ID
  4. 自身の Notion データベースのプロパティ名に修正する

    import-japanese-holidays.js

     await notion.pages.create({
         parent: {
           type: "database_id",
           database_id: databaseId,
         },
         properties: {
             Name: { // プロパティ名
                 title: [],
             },
             Date: { // プロパティ名
                 date: {},
             },
  5. スクリプトを実行する

    node import-japanese-holidays.js

注意

  • Notion のプロパティ

    詳細は Notion Page properties を参照ください。

  • Notion のページ ID

    ページ ID は、ページ URL の末尾にある 32 文字の文字列です。

  • 作成されるデータ

    現在の西暦の祝日データを取得し、それを Notion に追加します。

ライセンス

このスクリプトでは、🎌 Holidays JP API - MIT License を利用しています。

notion_import_japanese_holidays's People

Contributors

rikakohirata avatar

Watchers

 avatar

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.