Weather from terminal

Simply enter the following in a terminal:

curl wttr.in

And will get your location from /etc/timezone. Otherwise curl wttr.in/your_location. For example, for Tehran:

curl wttr.in/tehran

Which gives you:

Sample output

You can also compare two cities:

diff -Naur <(curl -s http://wttr.in/london ) <(curl -s http://wttr.in/new-york )

Source code of developer is available on Github.


Search for your city at http://www.accuweather.com and replace the URL in the following script with the URL for your city:

#!/bin/sh

URL='http://www.accuweather.com/en/de/berlin/10178/weather-forecast/178087'

wget -q -O- "$URL" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $2": "$16", "$12"°" }'| head -1

Sample output:

Berlin, Germany: Foggy, 1°

Here's a great semi-graphical command line utility written in Go:

https://github.com/schachmat/wego/

You'll need to install Go and setup some API stuff, but the instructions are there. Here's a sample pic:

enter image description here

Tags:

Command Line