Giter Club home page Giter Club logo

mydailyfundbot's Introduction

My Daily Fund Bot

功能

使用 AWS Lambda 搭配 EventBridge (CloudWatch Event) 定時發送每日資料至 Telegram

  1. MoneyDJ

    基金資料, 每日更新時間約為 9:30 ~ 10:00 之間

    EventBridge Schedule expression: cron(0 2 ? * TUE-SAT *)

  2. Yahoo Finance

    美股資料, 每日收盤時間為 04:00 (UTC+8), 夏令 05:00 (UTC+8)

    EventBridge Schedule expression: cron(30 21 ? * MON-FRI *)

參考資料

部署

要把 package 都包進 zip, 再上傳到 AWS Lambda

layer

另外一個做法是把 package 包成 zip, 放到 layer 內, 如果是 python, 要在 zip 內新增一個 python 資料夾

參考以下連結的 Include library dependencies in a layer

Creating and sharing Lambda layers - AWS Lambda

pillow.zip
│ python/PIL
└ python/Pillow-5.3.0.dist-info

AWS Lambda 範例

教學課程:在 Python 3.8 中建立 Lambda 函數 - AWS Lambda

Building a Telegram Bot with AWS API Gateway and AWS Lambda - DEV Community

設定 webhook

url 為 API Gateway 的 URL

https://api.telegram.org/bot{token}/setWebhook?url=https://{restapi_id}.execute-api.{region}.amazonaws.com/{stage_name}/

會回傳

{"ok":true,"result":true,"description":"Webhook was set"}

setwebhook - Telegram Bot API

在 Amazon API Gateway 中叫用 REST API - Amazon API Gateway

查看 webhook 資訊

https://api.telegram.org/bot{token}/getWebhookInfo

getwebhookinfo - Telegram Bot API

設定 command

可以用 @botfather, /setcommands

How to show options in telegram bot? - Stack Overflow

setmycommands - Telegram Bot API

python-telegram-bot

Extensions – Your first Bot · python-telegram-bot/python-telegram-bot Wiki

Webhooks · python-telegram-bot/python-telegram-bot Wiki

Beautiful Soup

css-selectors - Beautiful Soup Documentation

mydailyfundbot's People

Contributors

anemology 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.