This Twitter bot provides daily weather updates at 6 AM using the OpenWeatherMap API, paired with a unique text generated by ChatGPT. It's designed to keep followers informed with the latest weather information in an engaging way.
- Daily Weather Updates: Automatically fetches and posts weather updates every day at 6 AM.
- Enhanced with ChatGPT: Each update includes a custom message generated by ChatGPT, adding a personal touch to the weather forecasts.
- Automated with Cron: Uses Cron jobs for scheduling daily posts.
- Twitter API v2 Integration: Posts updates directly to Twitter using the latest version of the Twitter API.
Before you begin, ensure you have the following:
- Node.js installed on your system.
- A Twitter Developer account and access to Twitter API v2.
- An FreeAPI key from OpenWeatherMap.
Clone the repository
git clone [email protected]:LouisLoveCryptoo/caen-weather-daily.git
Install the required Node.js packages:
npm install fs path cron openai twitter-api-v2
Create a .env file in the root directory and fill in your credentials:
WEATHER_API=
OPENAI_API_KEY=
ACCESS_TOKEN=
ACCESS_TOKEN_SECRET=
X_API_KEY=
X_API_KEY_SECRET=
node index.js
Feel free to fork this repository and submit pull requests with your own improvements.