https://github.com/connorrmcd6/market-updates-bot
https://github.com/connorrmcd6/market-updates-bot
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/connorrmcd6/market-updates-bot
- Owner: Connorrmcd6
- Created: 2021-12-21T10:34:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-13T08:30:21.000Z (over 4 years ago)
- Last Synced: 2025-03-04T08:11:22.467Z (over 1 year ago)
- Language: Python
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This script sends a daily update on various markets via telegram
Configs set up:
- Rename the example_configs.py file to "configs.py"
- Download Telegram and start a chat with @BotFather, send "/newbot" and follow the prompts to create your own bot
- Save the API token as telegram_api_key in the configs.py file
- To get chat_id, start a chat with @userinfobot and send it "/start" then save the ID as chat_id in the configs.py file
- To get channel_id, create a **public** channel on Telegram and assign the channel name to the channel_id variable in the configs.py file
- Add your bot to the Telegram channel and make it an admin
- To get the stock fear and greed index, create an account at https://rapidapi.com/rpi4gx/api/fear-and-greed-index/ to get a valid API key
- put this API key in the keys dictionary assigned to x-rapidapi-key in the configs.py file
- Test the bot by running the main.py file
- If you are sending to specific chats, you should uncomment the commented lines in the crypto.py and stocks.py files and comment out the lines above them
***IMPORTANT: when sending messages directly to users (using chat_id instead of channel_id) the person recieving the message from the bot must first send the bot a message such as 'hello world' to grant permission for the bot to send messages. If you do not do this you will get the following: {'description': 'Bad Request: chat not found', 'error_code': 400, 'ok': False}. This is a saftey feature created by telegram to prevent bots from sending out unsolicited messages***
Tickers:
All ticker data is sourced from yahoo finance. The fear and greed indexes are accessed via https://rapidapi.com/rpi4gx/api/fear-and-greed-index/ (stocks) and https://alternative.me/crypto/fear-and-greed-index/ (crypto). The market heat map is provided by https://quantifycrypto.com/widget/heatmap
automation suggestions:
Run crypto.py or stocks.py on a task scheduler of your choice (cronjob/windows task scheduler are highly recommended)