• Bent Petersen

Weather forecast in your terminal using wttr.in

As a bioinformatician, I love my terminal. The terminal is where I work and what I see the most.


If you are wondering what the weather will be like and you are feeling a little nerdy and too lazy to open a browser, you mind find this little code a bit interesting.


1. Open your favourite terminal

2. Type the following code

function myweather(){
    curl wttr.in/$1
}

3. With a simple command, you can now see the weather forecast in ASCII-characters

myweather

The weather forecast is obtained using your IP-address if you want the weather forecast for a specific location you can now obtain it like this:

myweather rio

If you are travelling a lot and thinking in 3-letter Airport-codes:

myweather KUL

As you can see from the picture below, they the airport-code is looked up and the weather forecast for "KLIA, KLIA Arrival, Sepang, Selangor, 64000, Malaysia [2.74552395,101.701506799265] is received


You might also be travelling to a special location:

myweather eiffel+tower

There are loads of other features, which all can be used in your terminal or even implemented as a widget or at your website.


Check out all the features at Igor's Github-page: https://github.com/chubin/wttr.in

154 views

Contact

Bent Petersen

University of Copenhagen
GLOBE Institute
Section for Evolutionary Genomics
Øster Farimagsgade 5
1353 Copenhagen K
DENMARK

  • Black Facebook Icon
  • Black Twitter Icon
  • Black Instagram Icon
  • LinkedIn

© 2020 by Bent Petersen

Subscribe to Site