Files
go-weather/README.md
T

34 lines
861 B
Markdown
Raw Normal View History

2022-02-17 10:45:34 +00:00
# Go OpenWeather
This is a simple (but messy) Go project I am working on in my spare time!
It pulls JSON data from [here](https://openweathermap.org/) and uses 'encoding/json' to sort the data!
## Usage
You will need a OpenWeather API-Key. This can be done by opening a free account and creating a key!
```
./go-weather -h
```
Will give:
2022-02-25 13:55:53 +00:00
```text
Usage of ./go-weather:
2022-02-17 10:45:34 +00:00
-api string
2022-02-25 13:55:53 +00:00
Enter you api key here (default "none")
2022-02-17 10:45:34 +00:00
-city string
2022-02-25 13:55:53 +00:00
Enter city e.g. London (default "London")
2022-02-17 10:45:34 +00:00
-code string
2022-02-25 13:55:53 +00:00
Enter Code e.g. uk (default "uk")
2022-02-17 10:45:34 +00:00
```
2022-02-25 13:55:53 +00:00
Running the command in a terminal like so:
2022-02-17 10:45:34 +00:00
```
./go-weather -api=API-KEY -city=Glasgow -code=uk
```
2022-02-25 13:55:53 +00:00
**Will give:**
2022-02-17 10:45:34 +00:00
```
2022-02-17 17:04:20 +00:00
02/17/2022 17:03
📍Location: Glasgow, GB
Weather:☁️ Clouds (few clouds)
🌡️ Temp: 5.46°C (Feels like: 2.36°C)
(Min: 3.97°C, Max: 6.22°C)
🌅Sunrise: 07:37 🌇Sunset: 17:24
2022-02-17 10:45:34 +00:00
```