🌍 TodayQuakes: A Daily Seismic Activity Bot Powered by the USGS API

GitHub X


TodayQuakes is a fully automated Twitter bot providing daily insights into global seismic activity. By leveraging the USGS API, it retrieves earthquake data from the previous day, generates detailed visual maps of quake locations, and posts the results on X (formerly Twitter) via the X API.

Summary

🔍 Introduction

Seismic activity occurs daily around the world, yet it often goes unnoticed. TodayQuakes bridges this gap by automatically posting a daily snapshot of global earthquake activity, offering users a simple yet powerful way to stay informed.

With a focus on accessibility, the bot combines data analysis, visualization, and automation, making seismic data digestible for a wide audience.

🗺️ Data and Visualization

The project relies on the USGS Earthquake Hazards Program to fetch earthquake data, including magnitudes, locations, and timestamps. Using Python’s powerful data visualization libraries, a map is generated daily, highlighting:

  • Locations of all recorded earthquakes.
  • Distribution of earthquake magnitudes.
  • Total number of seismic events.
Example of Visualization created

The bot seamlessly transforms raw seismic data into visually appealing and informative maps, which are then posted to its Twitter/X account.

⚙️ Automation

TodayQuakes is built for efficiency and operates without manual intervention. Key automation features include:

  1. Data Retrieval: Daily fetches earthquake data via the USGS API.
  2. Visualization: Generates visual earthquake maps using Matplotlib.
  3. Posting: Uses the X API to post maps and statistics.
  4. Scheduling: GitHub Actions runs the bot every day, ensuring timely updates.

The project is structured for maintainability, with clear separation of concerns:

  • DailyQuakes.py: Handles data processing and visualization.
  • bot.py: Manages interaction with the X API.
  • .github/workflows/bot.yml: Defines the GitHub Actions workflow for daily execution.
Example of a Twitter/X post by TodayQuakes

✅ Conclusion

TodayQuakes demonstrates how automation and data visualization can transform raw seismic data into accessible insights. It provides a valuable resource for anyone interested in monitoring global seismic activity, from researchers to the general public.

Explore the codebase on GitHub or follow the bot’s updates on X.


GitHub @titouanlegourrierec  ·  Email titouanlegourrierec@icloud.com