GithubHelp home page GithubHelp logo

past-tweets-notifier's Introduction

past-tweets-notifier

下記で Notion Database に保存している過去の Tweet を通知するツール。現状は Gmail を用いたメール通知に対応

https://github.com/shun91/ifttt-to-notion

セットアップ

Notion Database に rand プロパティの追加

後述する notifyRandomly.ts を利用したい場合、rand プロパティを追加する必要があります。
各項目の値は以下のように設定します。

項目
種類 数式
数式 toNumber((floor(timestamp(now()) / 60000) * toNumber(replaceAll(id(), "[^0-9]", ""))) % 100000)
数値の形式 数値

参考:Notion のデータベースでランダムに 1 件だけ表示する方法 - Notion ラボ

環境変数の設定

.envrc.sampleに記載されている環境変数を設定します。

NOTION_API_KEY については、Notion API を使用したインテグレーションの作成 を参考にして、Notion API のトークン(key)を作成します。

GMAIL_APP_PASSWORD については、アプリ パスワードでログインする - Gmail ヘルプ を参考にして、Gmail のアプリパスワードを作成します。

依存ライブラリのインストール

yarn

使用方法

yarn ts-node src/notifyRandomly.ts

上記のコマンドを実行すると、Notion Database からランダムに選ばれた過去の Tweet を 1 件取得し、それをメールで通知します。

yarn ts-node src/notifyYesterdayTweets.ts

上記のコマンドを実行すると、Notion Database から前日に作成された全ての Tweet を取得し、それをメールで通知します。

定期実行

.github/workflows/notify.ymlで設定しています。

past-tweets-notifier's People

Contributors

shun91 avatar

Stargazers

 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.