You are not logged in.
I've had a programming bug up my a** the last couple of days and made this.
[tyler@eLINUXe ~]$ weatherget -h
usage: weatherget [options]
options:
-h, --help show this help message and exit
-v, --version display version and exit
-s ID, --station-id=ID station id (U.S. users can use zip)
-l CITY, --lookup=CITY lookup station id for CITY
-c CITY, --city=CITY lookup and use station id for CITY
-S, --standard use standard units
-m, --metric use metric units
-e NUMDAYS, --extended-day=NUMDAYS provide and extended day forecast as
specified in NUMDAYS
You can use a --station-id=ID (for US users zip code will work) or --city=CITY enclosed in double quotes which will translate it automaticaly. I do however, suggest using --lookup=CITY once to get your station id and using that instead because weather.com's server doesn't like having to do too many translations at once. You must also specify --standard or --metric for the units. An extended day forecast is optional through --extended-day=NUMDAYS.
A simple example:
[tyler@eLINUXe ~]$ weatherget --lookup="Wilmington, NC"
station id for Wilmington, NC is USNC0760
[tyler@eLINUXe ~]$ weatherget --station-id=USNC0760 --extended-day=3 --standard
New Hanover International Airport, NC 8/3/06 5:25 PM EDT
time zone: -4 GMT
sunrise: 6:24 AM
sunset: 8:11 PM
uv: Moderate, 3
temperature: 92 F
feels like: 103 F
conditions: Sunny
wind: 12 mph, 0 mph gusts, S
humidity: 58 %
barometer: 29.88 in, falling
dewpoint: 75 F
visibility: 8.0 mi
moon: Waxing Gibbous
HEAT WARNING UNTIL THU AUG 03 2006 07:00 PM EDT
http://www.weather.com/weather/alerts?alertId=53941
Tonight:
sunrise: 6:24 AM
sunset: 8:11 PM
high: N/A F
low: 79 F
conditions: IsolatedT-Storms
wind: 11 mph, 0 mph gusts, S
precipitation: 30 %
humidity: 83 %
Friday:
sunrise: 6:24 AM
sunset: 8:10 PM
high: 94 F
low: 78 F
conditions: IsolatedT-Storms
wind: 10 mph, N/A mph gusts, S
precipitation: 30 %
humidity: 66 %
Saturday:
sunrise: 6:25 AM
sunset: 8:09 PM
high: 88 F
low: 76 F
conditions: ScatteredT-Storms
wind: 8 mph, N/A mph gusts, S
precipitation: 40 %
humidity: 73 %
The read out style is not hardcoated and in fact can be configured in ~/.weathergetrc. It should be self explanitary. Realize however, it must follow python syntax so keep the indentions where they're at.
The coolest thing about this is that you can use it in something like conky using exec <interval> . My line in .conkyrc:
${color #0077ff}Local Weather:
$color ${execi 1200 /usr/bin/weatherget --station-id=28403 --standard}
This should work in most platforms but I haven't properly packaged it yet with a setup.py file so installation will have to be done manually for now.
EDIT:
uploaded to AUR
Enjoy or whatever.
Offline
Thanks Penguin, this looks pretty cool. I used a weather checker that was on the conky project page, but this one seems much nicer.
Offline
Simply awesome. Thanks.
Offline
Offline
thanks guys. I added another switch to specify an alternate config file and uploaded it to AUR
Offline
Great stuff. I have been working on a perl version using the noaa's SOAP service, off and on (mostly off) for the last few months. This is great. Thanks.
One thing, though. It chokes if you give it an invalid number of days:
Traceback (most recent call last):
File "./bin/devel/weather/weatherget.py", line 479, in ?
day_dict = dayf().index_and_day(NUMDAYS)
File "./bin/devel/weather/weatherget.py", line 286, in index_and_day
line = reg_tag('day d="'+str(day_index)+'"', self.dayf)[0]
IndexError: list index out of range
Offline
Are you using version from AUR I just uploaded? I fixed that to not accept anymore than 10 days.
Offline
Aahhh. I grabbed it before you had it up on the AUR. Thanks.
Offline
Sweet. I like simple and elegant programs like this. It's what makes the Linux world go 'round.
Offline
nice program - good to have in a root tail running in the background
IBM T41p - 2373-xXx - kernel26thinkpad
Offline
Very nice!
This now gets added to my screen session specifically for system monitors and the like
Offline
Why does http://xoap.weather.com/search/search?w … burg,%20VA work, and weatherget --location="Blacksburg, VA" not?
Offline
Why does http://xoap.weather.com/search/search?w … burg,%20VA work, and weatherget --location="Blacksburg, VA" not?
Hi
I have the same problem. In my case instead of Blackburg, it is Calcutta. When I try to check:
weatherget --lookup=Calcutta
no station id found for `Calcutta'
I get no station id found. But the url works:
http://xoap.weather.com/search/search?where=calcutta
What seems to be wrong?
Thanks in advance and it is a great script, will help me learn Python
Sudeep
Offline
Why does http://xoap.weather.com/search/search?w … burg,%20VA work, and weatherget --location="Blacksburg, VA" not?
There is no --location switch. --lookup doesn't work for you?
[tyler@eLINUXe ~]$ weatherget --lookup="Blacksburg, VA"
station id for Blacksburg, VA is USVA0068
Remember you can't query the server too many times for city translations, it just locks up.
Offline
codemac wrote:Why does http://xoap.weather.com/search/search?w … burg,%20VA work, and weatherget --location="Blacksburg, VA" not?
Hi
I have the same problem. In my case instead of Blackburg, it is Calcutta. When I try to check:
weatherget --lookup=Calcutta
no station id found for `Calcutta'I get no station id found. But the url works:
http://xoap.weather.com/search/search?where=calcutta
What seems to be wrong?
Thanks in advance and it is a great script, will help me learn Python
Sudeep
You have to be more specific than just "calcutta". It matches what is between the tag points (> and <) exactly.
If I type in just the city for my location I would get four or five different matches. Use the state/country as well: "Calcutta, India". The case however shouldn't matter, I'll change that next time to not be case sensitive.
Offline
ok, changed the behavior of --lookup=CITY to display all matches instead of exact only and to not be case sensitive. It should help people find there station id a little easier. Also some very minor cosmetic changes to the default ~/.weathergetrc file.
It does work in windows just fine...if anyone here cares.
Offline
I've gotta start writing more POS apps. I get lazy and never maintain them and you take the idea and make something nice out of it. Maybe you can do a text editor or 3D virtual environment next.
I still had finding my station id because I can't spell the name of my city:
dusty:~ $ weatherget -l sucksass
no station id found for `sucksass'
Perhaps you need a spell correction feature too.
Nice work! Oh, and nice choice of language!
Dusty
Offline
I've put this up at berlios now so I can finally put my server to rest.
Please direct all your bug reports/feature requests/etc there, it will be easier for me to keep track of.
http://developer.berlios.de/projects/weatherget
Offline
Very nice app. Perfect for the command line, no desktop clutter.
Offline
Enjoying the excellent weatherget program very much. Thanks and thanks again!
Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit! X-ray confirms Iam spineless!
Offline
Thanks. Glad you find it useful.
Offline
excellent! great little program.
for now i just have an alias, but it would be cool to be able to specifiy the ID and the -S or -m in the config file -- or not knowing python am i just missing how to do it?
thanks, very useful
Offline
Your not missing anything. Adding those variables to the rc file won't make it work either. Given its nature, my intention was to be able to alias it as you did or include it with all the needed args in a periodic script like conky...
Offline
Google: weather (zip) gives weather report also......
Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit! X-ray confirms Iam spineless!
Offline
yeah but can it run without X?
Offline