This bot automatically fetches weather data for multiple French cities and posts it on Twitter twice a day at 8 AM and 2 PM.
It uses WeatherAPI to get real-time weather data and tweets the temperatures with appropriate weather emojis.
🔗 Follow the Bot on Twitter (X) : WeatherBot
✅ Fetches real-time weather data for major French cities
✅ Posts temperatures with weather emojis ☀️⛅🌧️❄️
✅ Distinguishes between morning and afternoon (before and after 12 PM UTC)
git clone https://github.com/Apouuuuuuu/TwitterWeatherBot.git
cd TwitterWeatherBotnpm installCreate a .env file at the root of the project and add your API keys:
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_SECRET=your_twitter_access_secret
WEATHER_API_KEY=your_weather_api_keyDelete the .github/ directory and what it contains.
It is used for the Github Action deployment.
node bot.jsGo to your repository → Settings → Secrets and variables → Actions
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_SECRET=your_twitter_access_secret
WEATHER_API_KEY=your_weather_api_keyNode.js – JavaScript runtime
Twitter API v2 – Posting tweets
WeatherAPI – Fetching weather data
GitHub Actions
🔓To obtain your Twitter API keys, sign in and create an app in the X Developer Portal.
🔓To obtain your Weather API key, sign in and generate a new API key on the WeatherAPI website.
If you have any questions or issues, feel free to reach out! 🚀