CurseTheWeather
Overview
CurseTheWeather is a python application comprising of two parts:
- weatherfeed.py = The backend which gets the weather from the internet
- ctw.py = An ncurses frontend with uber fancy ascii-art weather icons. Actually, the icons suck, but the app is good :)
It is released under the GNU GPL version 2 source:trunk/ctw/GPL.gz and is Copyright 2004 Dan Cardamore <dan@…>
Screenshots
On putty (windows xp)
source:/trunk/ctw/screenshots/putty_ctw.png
On ITerm (Mac OS X)
source:/trunk/ctw/screenshots/osx_iterm_ctw.png
Installation
Download
You can download the latest release which is 0.6 using the following link source:
source:/trunk/ctw/dist/CurseTheWeather-0.6.tar.gz
Installing on UNIX
- untar:
tar zxvf CurseTheWeather-0.6.tar.gz
- enter into the directory:
cd CurseTheWeather
- Install:
python setup.py install
Usage
Determining your location
To determine your location code:
- visit: http://www.weather.com
- get your local forecast
- look at the URL, it will look similar to:
http://www.weather.com/outlook/travel/local/CAXX0343?from=search_city
- Your location code is the part after "local/" and before "?from"
in this example it is CAXX0343
ctw
ctw is the curses front end to weatherfeed.py. Its usage is much simpler. Basically, start off with a terminal (color prefered) and then run it using the syntax:
ctw CAXX0343
The location code "CAXX0343" is for Ottawa, Canada. You'll need to find your own location code. See the usage documentation above to find out how.
Once you're in ctw, you can quit by hitting 'q', or 'ctrl-c'.
weatherfeed.py
Weatherfeed can be used by including it into your python application. After installing the module, add the following code to your python application:
from weatherfeed import Weather
Once you've imported it, you can get your data by instantiating the Weather() class:
location="CAXX0343" w = Weather(location)
Then you can access the public dictionaries:
w.currentConditions["temperature"] w.forecast[2]["high"]
To find out what the public dictionaries look like, you can print them:
print w.toString()
Get The Source
- Browse the source source:trunk/ctw
- Get the source using your subversion client: https://hld.ca/svn/open/ctw
Submit a bug
To submit a bug against CurseTheWeather, click on "New Ticket" at the top.
