Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Prerequisite
- It assumes you have `curl` installed in your system.
- # Install
- Create a file in users' home directory named `.weather`
- ```
- touch ~/.weather
- ```
- put the following code in the file-
- ```
- #!/usr/bin/env bash
- curl wttr.in/${1:-Münster}
- ```
- Now change the permission of the file to executable.
- ```
- sudo chmod +x ~/.weather
- ```
- Now create an alias in your `.bashrc` or `.zshrc` file.
- ```
- alias weather="sh ~/.weather"
- ```
- # Uses
- In the command line, just type `weather`. It will show the weather of Münster as mentioned in the .weather file.
- You can change it to your current location. If you want to see the weather of other location, just type `weather name_of_the_place`
- like `weather Dhaka`, it will show the weather of that place.
- # Output Example
- ```
- weather Münster
- \ / Partly cloudy
- _ /"".-. 27 °C
- \_( ). ↗ 26 km/h
- /(___(__) 10 km
- 0.0 mm
- ┌─────────────┐
- ┌──────────────────────────────┬───────────────────────┤ Wed 20 Jun ├───────────────────────┬──────────────────────────────┐
- │ Morning │ Noon └──────┬──────┘ Evening │ Night │
- ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
- │ \ / Partly cloudy │ _`/"".-. Patchy rain po…│ \ / Partly cloudy │ \ / Partly cloudy │
- │ _ /"".-. 21 °C │ ,\_( ). 24-26 °C │ _ /"".-. 25-26 °C │ _ /"".-. 21 °C │
- │ \_( ). ↗ 13-16 km/h │ /(___(__) ↗ 15-17 km/h │ \_( ). → 14-21 km/h │ \_( ). → 12-24 km/h │
- │ /(___(__) 20 km │ ‘ ‘ ‘ ‘ 20 km │ /(___(__) 20 km │ /(___(__) 20 km │
- │ 0.1 mm | 58% │ ‘ ‘ ‘ ‘ 0.0 mm | 29% │ 0.0 mm | 0% │ 0.1 mm | 49% │
- └──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
- ┌─────────────┐
- ┌──────────────────────────────┬───────────────────────┤ Thu 21 Jun ├───────────────────────┬──────────────────────────────┐
- │ Morning │ Noon └──────┬──────┘ Evening │ Night │
- ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
- │ Overcast │ _`/"".-. Light rain sho…│ \ / Partly cloudy │ \ / Partly cloudy │
- │ .--. 16 °C │ ,\_( ). 17 °C │ _ /"".-. 13-15 °C │ _ /"".-. 9-12 °C │
- │ .-( ). → 27-35 km/h │ /(___(__) → 34-40 km/h │ \_( ). → 28-38 km/h │ \_( ). → 23-37 km/h │
- │ (___.__)__) 15 km │ ‘ ‘ ‘ ‘ 14 km │ /(___(__) 17 km │ /(___(__) 18 km │
- │ 0.4 mm | 61% │ ‘ ‘ ‘ ‘ 0.3 mm | 88% │ 0.0 mm | 0% │ 0.0 mm | 0% │
- └──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
- ┌─────────────┐
- ┌──────────────────────────────┬───────────────────────┤ Fri 22 Jun ├───────────────────────┬──────────────────────────────┐
- │ Morning │ Noon └──────┬──────┘ Evening │ Night │
- ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
- │ Overcast │ _`/"".-. Light rain sho…│ _`/"".-. Patchy rain po…│ Cloudy │
- │ .--. 10-13 °C │ ,\_( ). 13-14 °C │ ,\_( ). 13-14 °C │ .--. 10-12 °C │
- │ .-( ). → 29-40 km/h │ /(___(__) → 26-35 km/h │ /(___(__) ↘ 23-32 km/h │ .-( ). → 19-30 km/h │
- │ (___.__)__) 15 km │ ‘ ‘ ‘ ‘ 14 km │ ‘ ‘ ‘ ‘ 14 km │ (___.__)__) 16 km │
- │ 0.5 mm | 55% │ ‘ ‘ ‘ ‘ 0.3 mm | 27% │ ‘ ‘ ‘ ‘ 0.2 mm | 27% │ 0.1 mm | 48% │
- └──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
- Location: Münster, Regierungsbezirk Münster, Nordrhein-Westfalen, Deutschland [51.9501317,7.61330165026]
- New feature: multilingual location names wttr.in/станция+Восток (in UTF-8) and location search wttr.in/~Kilimanjaro (just add ~ before)
- Follow @igor_chubin for wttr.in updates
- ```
Add Comment
Please, Sign In to add comment