This Rust program fetches data about nearby comets and space programs. It uses asynchronous requests to retrieve data from NASA's Near Earth Object Web Service and SpaceX API.
- Fetches and displays comet data, including name, close approach date, and miss distance.
- Fetches and displays space program data, including name, description, and agency.
- Allows user to specify the number of comets and space programs to display.
- Provides options to sort comet data by distance and time, and space program data by launch time.
- Rust (https://www.rust-lang.org/tools/install)
- Cargo (comes with Rust)
- NASA API Key (optional, a demo key is used by default)
-
Clone the repository
git clone https://github.com/dominikstas/astro.git cd astro
-
Set up your environment
export NASA_API_KEY=your_api_key_here
-
Run the program
cargo run
Upon running the program, it will prompt you with:
- Whether you want to see comet data.
- How many comets you want to see.
- Whether you want to see space program data.
- How many space programs you want to see.
- How you would like to sort the comet data (by distance or time).
- How you would like to sort the space program data (by launch time).