on-this-day

Crates.ioon-this-day
lib.rson-this-day
version0.1.1
created_at2025-10-23 21:23:59.8549+00
updated_at2025-10-23 21:40:38.979753+00
descriptionA CLI tool to fetch a historical event for the current day from Wikipedia.
homepage
repository
max_upload_size
id1897712
size61,571
Eric Yu (yu-eric)

documentation

README

On This Day CLI

A simple command-line tool that fetches historical events for the current date from Wikipedia's "On this day" API. Get interesting facts about what happened on this day in history!

Features

  • Fetches real-time data from Wikipedia's "On this day" API
  • Filter events by type (all, selected, births, deaths, holidays, events)
  • Display oldest or newest events, or get a random selection

Installation

Make sure you have Rust installed on your system. Then clone and build the project:

git clone <repository-url>
cd on-this-day
cargo build --release

Usage

Run the application with:

cargo run

Or after building:

./target/release/on-this-day

Command Line Options

Flags

  • -o, --oldest: Display the oldest event for today (conflicts with --newest)
  • -n, --newest: Display the newest event for today (conflicts with --oldest)
  • -h, --help: Print help information
  • -V, --version: Print version information

Event Type Filter

  • -t, --event-type <TYPE>: Filter by event type

Available event types:

  • all (default): Shows events from all categories
  • selected: Curated selection of notable events
  • births: Notable births that occurred on this day
  • deaths: Notable deaths that occurred on this day
  • holidays: Holidays and observances
  • events: General historical events

Dependencies

This project uses the following Rust crates:

  • reqwest - HTTP client for API requests
  • serde & serde_json - JSON serialization/deserialization
  • tokio - Async runtime
  • chrono - Date and time handling
  • clap - Command-line argument parsing
  • rand - Random selection of events

API

This tool uses the Wikimedia REST API to fetch historical events. The API is free to use and doesn't require authentication, but the application includes a proper User-Agent header as required by Wikipedia's policies.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Commit count: 0

cargo fmt