These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need the below installed on your computer
$ git clone https://github.com/richierich25/weather-bot.git $ cd weather-bot $ npm i
Create a file called
.env in the root directory of your project. OR Note: Instead of creating a
.env file, create a replica of the
env.example file provided
$ cp env.example .env
WEATHER_API_TOKEN = "YOUR OPEN WEATHER API TOKEN HERE"
.env file, add key
TELEGRAM_CHAT_ID obtained from Telegram Bots App. Follow the below steps:
botat its end, for instance
HTTP API Keyor
TELEGRAM_TOKEN. Open the link provided. important as the bot has to be started for it to receive messages later
startor to start chatting with the newly created bot
TELEGRAM_CHAT_ID, search for the
@get_id_botaccount and press
TELEGRAM_TOKEN = "YOUR TELEGRAM TOKEN HERE" TELEGRAM_CHAT_ID = "YOUR TELEGRAM CHAT ID HERE"
index.js, set the
id corresponding to your city obtained from here.
search, for instance,
https://openweathermap.org/city/1273294where 1273294 will be the ID corresponding to the city
weatherURL.searchParams.set('id', '1273294'); // use the desired id here
When you are done with the setup, and have tested locally, we recommend you to deploy it using Github Actions. We highly recommend to read through the Using Github Actions docs.
.github/workflows/run-weather-bot.yml file, set the desired time interval in CRON FORMAT after which you wish the Application to execute and push further notifications
schedule: - cron: '0 */3 * * *' #after every 3 hours
Adding API Tokens and Secrets into the repository
Settingsfrom the Github Menu options
Secretsfrom the left section
New Secretand add your tokens one by one by giving it a suitable
If you wish to contribute and make it much better for other developers, please have a look at Issues.
If you can help us with these. Please don't hesitate to open a pull request.
We encourage you to contribute. Please check out the Contributing guide for guidelines on how to proceed.
Source Code: https://github.com/richierich25/weather-bot
node-canvas is a Cairo-backed Canvas implementation for Node.js.
A Guide to Hire Node.js Developers who can help you create fast and efficient web applications. Also, know how much does it cost to hire Node.js Developers.
Looking to build dynamic, extensively featured, and full-fledged web applications? **[Hire NodeJs Developer](https://hourlydeveloper.io/hire-dedicated-node-js-developer/ "Hire NodeJs Developer")** to create a real-time, faster, and scalable...
The main goal of this blog is to explain the “Architecture of Nodejs” and to know how the Nodejs works behind the scenes. Generally, most of the server-side languages, like PHP, ASP.NET, Ruby, and including Nodejs follows multi-threaded architecture. That means for each client-side request initiates a new thread or even a new process.
Node.js for Beginners - Learn Node.js from Scratch (Step by Step) - Learn the basics of Node.js. This Node.js tutorial will guide you step by step so that you will learn basics and theory of every part. Learn to use Node.js like a professional. You’ll learn: Basic Of Node, Modules, NPM In Node, Event, Email, Uploading File, Advance Of Node.