Giter VIP home page Giter VIP logo

dc_twitter-space-notif_backend's People

Contributors

yutanakamizo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dc_twitter-space-notif_backend's Issues

複数 Twitter API キーに対応 / その他の通知設定もファイルで指定

アイデア

Twitter API Key と監視対象 Twitter ユーザ ID などを .env ではなく YAML で記述する.
ついでに各種設定にも対応したい.

targets:
  {Twitter User ID}: # (not screenname)
    twitter_bearer_token: {Twitter Bearer Token Alias}
    interval: {nodecron Interval String}
    destinations:
      {Destination Alias}:
        type: {Destination Type <"webhook" | "discord.webhook" | "twitter.tweet">}
        # Webhook
        url: {Webhook URL}
        {...webhook Options}
        # Discord - Webhook
        url: {Webhook URL}
        {...discord.webhook Options}
        # Twitter - Tweet
        token: {Twitter User Access Token}
        secret: {Twitter User Access Secret}
        token_file: {Twitter User Access Token File Path}
        secret_file: {Twitter User Access Secret File Path}
        {...twitter.tweet Options}
      ...
  ...

twitter_bearer_tokens:
  {Twitter Bearer Token Alias}:
    token: {Twitter Bearer Token}
    token_file: {Twitter Bearer Token File Path}
  ...

Notifiers を DB で管理したい場合

Cloud Firestore, MySQL にも対応したい (#78)

まずは Firebase から取得する前提で進める.

notif - /usr/src/notif-app/config.yml

targets:
  {Twitter User ID}: # (not screenname)
    twitter_bearer_token: {Twitter Bearer Token Alias}
    interval: {nodecron Interval String}
    destinations_firestore:
      token: {Firestore Token Alias}
      history_collection: ""
      destination_collection: ""
  ...

firebase_tokens:
  {Firebase Token Alias}:
    filename: "****.json" # in /usr/src/notif-app/firebase.d/
  ...

twitter_bearer_tokens:
  {Twitter Bearer Token Alias}:
    token: {Twitter Bearer Token}
    token_file: {Twitter Bearer Token File Path}
  ...

api - /usr/src/api-app/config.yml

targets:
  {Twitter User ID}: # (not screenname)
    destinations_firestore:
      token: {Firestore Token Alias}
      history_collection: ""
      destination_collection: ""
  ...

firebase_tokens:
  {Firebase Token Alias}:
    filename: "****.json" # in /usr/src/api-app/firebase.d/
  ...

Twitter Bot にツイートを送信

  • Bot アカウントのトークンを取得
    • トークン取得用の Web UI 実装
    • トークン記録バックエンド / エンドポイント実装
  • refreshToken を使った idToken の自動更新実装
  • idTokenを使ったツイート機能実装

README 作成

  • リポジトリの説明
  • Notif サービス / イメージの説明
    • 設定用 YAML の説明
  • Config サービス / イメージの説明

Docker の整理

  • ファイル配置の変更
  • Dockerfile 修正
  • docker-compose.yml 修正

Firebase Auth を検証

Close 条件

  • REST API を Express.js で実装 (任意の 1 エンドポイントを用意)
  • Firebase Auth の token を User Record に交換できる

複数回通知が飛ぶ問題

Twitter API を用いた Space 情報取得でのエラー発生時に state.json がリセットされてしまう.
--> currentSpacesAll の初期値を previousSpacesAll に変更

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.