Home > Technology > Weather Info from command line

Weather Info from command line

The web is a vast ocean of information. But, are all these information useful to everyone? May be NO. Take my example. I was so irritated with the hot summer and everyday I kept longing for a day, cooler than yesterday. So, I’ would visit weather.yahoo.com or msn weather to know about the weather info for the day and may be for the next few days. Everyday, opening a browser window, typing the URL address and getting the information was getting bit monotonous. Yes, you are right. I could have bookmarked the URL and click it whenever I want it. But, if I want weather info for 10 other cities of the world, where my relatives, friends live, bookmarking 10 URLs is not a good option. So, being a sole UNIX user, I thought why not a command line tool to get the weather info !!! The idea clicked and I wrote a small python program to do this using Yahoo Web Services.

The steps I followed:

1. Take the name of the city as user input from command line.

2. Find the Latitude / Longitude using Yahoo Map API.

3. Get the Where On Earth ID (WOEID) of the city using the info from Step 2. using Flicker API

4. Get the weather details using the WOEID using Yahoo Weather API.

As simple as that …

The program is tested with Python 2.5, 2.6. It wont work in Python 3.

mausam.py

[ mausam is a Hindi word meaning Weather ]

Advertisements
Categories: Technology
  1. Saurav Haloi
    December 31, 2011 at 8:06 PM

    This script don’t work any more as The Weather Channel no longer provides free access to their APIs.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: