Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Astronomy Event Notifier

A command-line application written in Go that periodically fetches real-time astronomy and weather data and delivers formatted notifications to the terminal.

Features

  • Sunrise & Sunset — retrieves sun times for a configurable location (Porto, Portugal by default)
  • Meteor Shower Tracker — checks for active and upcoming meteor showers based on the IMO annual calendar, with hemisphere visibility
  • Concurrent Fetching — queries multiple data sources in parallel using goroutines
  • Periodic Polling — uses time.Ticker for scheduled data updates
  • Graceful Shutdown — handles SIGINT/SIGTERM for clean exit
  • Extensible Design — modular structure makes it easy to add new data sources and notification channels

Tech Stack

Component Details
Language Go 1.22+
HTTP Client net/http (standard library)
JSON Parsing encoding/json (standard library)
Concurrency Goroutines, sync.WaitGroup, channels
Scheduling time.Ticker
APIs Sunrise-Sunset.org, IMO Meteor Shower Calendar

Project Structure

astro-notifier/
├── cmd/
│   └── main.go              # Application entry point
├── internal/
│   ├── api/
│   │   ├── weather.go        # Sunrise/Sunset API client
│   │   └── meteor.go         # Meteor shower tracker
│   ├── config/
│   │   └── config.go         # Application configuration
│   ├── models/
│   │   └── models.go         # Shared data structures
│   ├── notifier/
│   │   └── notifier.go       # Notification delivery
│   └── scheduler/
│       └── scheduler.go      # Periodic polling orchestrator
├── go.mod
└── README.md

How to Run

# Clone the repository
git clone https://github.com/paulo5/astro-notifier.git
cd astro-notifier

# Run directly
go run cmd/main.go

# Or build and run
go build -o astro-notifier cmd/main.go
./astro-notifier

Press Ctrl+C to stop the application gracefully.

Example Output

===========================================
       Astronomy Event Notifier
===========================================

2026/04/03 21:10:42 Using coordinates: 41.1579, -8.6291
2026/04/03 21:10:42 Scheduler started — polling every 10s
──────────────────────────────────────────────────
[21:10:42] Sunrise & Sunset Times
Source : Sunrise-Sunset API
Details: Sunrise: 07:17 | Sunset: 20:12 | Day length: 12h 55m
──────────────────────────────────────────────────

──────────────────────────────────────────────────
[21:10:42] Meteor Shower Status
Source : IMO Annual Meteor Shower Calendar
Details: Active: Lyrids (ZHR ~18, peak Apr 22) | Next: Eta Aquariids on May 6 (33 days away, ZHR ~50, visible from your location)
──────────────────────────────────────────────────

Future Improvements

  • ISS tracking — track the International Space Station position and proximity alerts
  • Near-Earth asteroids — integrate NASA NEO API for asteroid approach notifications
  • Moon phase tracking — notify about full moons, new moons, and eclipses
  • Multiple notification channels — add support for email, Slack, Discord, and desktop notifications
  • Configuration file — load settings from YAML/TOML instead of hard-coded defaults
  • CLI flags — accept latitude, longitude, and poll interval as command-line arguments
  • Unit and integration tests — add comprehensive test coverage with mocked HTTP responses

License

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

About

Astronomical Event Notifier in Go: monitors astronomical events and sends notifications to the terminal.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages