A Weather Widget For Your Terminal!


Getting weather info right on the terminal..?? Sounds cool.. Isn't it? With Python, it's even easier to make one! Lets get started.

First we need to determine the location of the user. So let's find out ip address. There are a lot of sites which gives the ip address but this site is the simplest & very easy to get.

Once we have the ip address, we can use it to determine the location and then use any weather api to get the info. However Worldweatheronline api gives weather info directly based on the api, which makes it easier to fetch data.

We can get the data in JSON format and by parsing it we can make the weather widget.

I wrote a simple script for that and here is the sample output of the script.

 


I am Chillar Anand. I daydream a lot and write about the things that interest me here. You can read more about this blog here.

See all articles

RSS Feed for the blog

Edit this page