XML Weather Feeds

September 2nd, 2005

Yahoo Weather

Yahoo just released rss weather feeds: http://weather.yahoo.com/rss.

This is fantastic. You can get current conditions as well as five-day forecast data. This is the same feed that is used by the Konfabulator widget.

The format of the URL for the feed is:

http://xml.weather.yahoo.com/forecastrss?p=USNY0996&u=f

p is a US zip or a Yahoo! Weather location ID
u is the temp. units. ‘F’ for Fahrenheit (default) and ‘C’ for celcius

A nice little addition to the feed is the latitude and longitude tags…

Here is a quick and dirty perl script that grabs the rss feed for my zip (10013) and prints the curr conditions and forecast to the screen. No error checking done (for readability)…

 
#!/usr/bin/perl -w
 
# grab weather xml from yahoo rss feed
 
use strict;
use LWP::Simple;
use XML::XPath;
 
my $data_url =
"http://xml.weather.yahoo.com/forecastrss?p=10013&u=f";
 
# get data and drop it in a file
my $xml_data = get ($data_url);
 
# use XPath to parse the file
my $xp = XML::XPath->new(xml => $xml_data);
 
# no error checking...
 
# current conditions
my $curr_cond =
$xp->find('/rss/channel/item/yweather:condition')->get_node(1);
 
print $curr_cond->find('@text') . ": " .
      $curr_cond->find('@temp') . "\n\n";
 
# forecast
foreach my $forecast ($xp->find('/rss/channel/item/yweather:forecast')->get_nodelist)
{
  print $forecast->find('@day') . ": " .
        $forecast->find('@text') . ". " .
        "High " . $forecast->find('@high') . ", " .
        "Low "  . $forecast->find('@low') . "\n";
}

National Weather Service

The National Weather Service has XML weather feeds available at http://www.weather.gov/xml/. You can get current conditions, forecasts, watch/warnings, etc… The current conditions have a REST API while the forecasts are SOAP.

For current conditions/observations, they have both RSS and CAP/XML feeds.
Examples of the feeds:
Central Park NYC RSS Feed
Central Park NYC XML Feed

Weather.com

You can sign up to get access to weather.com’s current conditions and forecast feeds at http://www.weather.com/services/xmloap.html. During the signup, they ask you what type of application the data will be used in and they throw a few pages of lame offers at you (“Sign me up for Timely Gardening Tips from Miracle-Gro”). wtf!?

I think the original Konfabulator widget used the weather.com feed…I seem to remember poking through the javascript at one point. Anyway, no need to go through the signup process for weather.com when you can use the Yahoo! or NWS feeds.

WeatherBug

WeatherBug released their weather API (REST) a few months ago: http://api.weatherbug.com/default.aspx.

You have to sign up and get a license code to use it.

According to the site, you can access:

Color Syntax for VIM on OS X

August 31st, 2005

vim

I recently tried installing gvim on my mac (highly disappointing) and accidentally wiped out my old .vimrc file in the process. The old .vimrc file had the settings to enable color syntax. So after uninstalling gvim, I was left with the default vim (v6.2) with no color syntax. Easy enough to fix, so I searched google for the settings, since I can never remember them. There are plenty of posts which will tell you to do the following to enable color syntax from vim:

:set term=builtin_beos-ansi
:syntax on

This gave me some weak syntax coloring/markup, where the only coloring was red and most of the code in a file (I was looking at a php file) was underlined. So, I set the term to “ansi” and it fixed things nicely.

:set term=ansi
:syntax on

Drop those lines into your ~/.vimrc file (without the colons) and you should be set…. assuming you have all of the syntax files installed on your machine.

Nice GMail Features

August 29th, 2005

GMail has a great new feature where you can customize your “From” address in outgoing email. Now its easy to manage all of your email accounts from GMail. I have my additional email account forwarded to GMail and can manage all of my email from a single account.

Another nice feature is the keyboard shortcuts. You can navigate through GMail without using the mouse. I love the vi-esque “k” (up/newer conversation) and “j” (down/older conversation) movement shortcuts.

Also, now anyone is able to singup for a GMail account.

Google Maps API

June 29th, 2005

Google just announced the “official” Google maps API. Nice!

Can’t wait to see what kind of apps that will start popping up now. We’ll have one out in the next month of so…

Mac Mini Ram Upgrade

June 8th, 2005

I picked up a Mac Mini in back in January — the 1.25 GHz, 256 Megs Ram, 40 Gig hard drive version. It’s a nice machine and I’m happy to finally be using OS X, but it’s definitely slow. OS X is a memory hog and the 256 Megs of ram doesn’t quite cut it. If I’m using Eclipse for some Java work, the machine grinds to a halt. Trying to use Eclipse, Firefox, Apache/Tomcat, iTerm (and maybe throw in iTunes) at the same time — not a chance. Switching from app to app takes forever.

So, this weekend, I picked up a gig of RAM from crucial for a little over $100 (the 1 GIG DDR PC2700). I think it was $200+ when I looked back in January… The RAM arrive today (two days, free delivery), so I went down to the local hardware store and grabbed a small putty knife ($5 for the 1 1/4″ size, flexible) to help open up the mini case.

There are plenty of sites and videos out there showing how to crack open the case. This one from macsales.com shows how to crack open the case, upgrade the ram and hard drive. If you’re going to open up your case, definitely check out one of these videos online before doing it. It was pretty easy to do — the tricks being 1) getting the putty knife in the side of the case to pry it open (you have to force it) and 2) getting everything lined up when closing the case back up. You can swap out the RAM without unscrewing anything (after you open up the case). All-in-all, it probably took only a few minutes…

Below are a few pictures of the process. The machine is running smoothly now with the new RAM — I highly recommend the upgrade if you have a mini. And with RAM prices that low (you can probably find a gig for $80-ish), why not?

True Value

Mac MIni Open

Mini with new and old RAM

1G of RAM

Google Maps Mashups

May 24th, 2005

Some cool hacks using google maps have come out in the past few weeks. Two in particular are the craigslist/google maps combo HousingMaps and the Chicago Crime site that allows you to track the location of the latest crimes in the Chicago area. There are plenty other cool mashups that have come out as well. I love the craigslist/gmaps combo — that’s the perfect way to search for housing using craigslist.

I’ve always thought that real estate is a great space for a location based app. You could get housing information and directions on your phone/pda while driving or walking around looking at homes. The app could provide you with info, say directions to open houses, based on some profile you create (possibly online). Nothing too exciting, but could be done pretty easily I think.

Anyway, back to google maps… After seeing the craigslist/gmaps hack last week, I tried to put throw together a little map of my own. We need a mapping component for the new application we’re working on, so I wanted to see how google’s works. I love how you can stay in the map and move in any direction by just dragging your mouse. It’s fun to explore manhattan that way using the satellite maps. Such a cool app. There are a few tutorials out there explaining how google’s mapping tech works (java script, xml over http, etc) and someone put together a demo [rancidbacon.com] on how to add your own custom data to google maps. After playing around with it a little bit last week, I put together a lame map that has an image of my building. I know…pretty weak, but it was very easy to set up.

Since we need a mapping component for the application we’re trying to put together, I need to start researching mapping solutions. I’m not sure what some of the providers change in terms of cost or if there are any decent free/open source services. I have a lot to learn there. How nice would it be if google opened up their maps as a web service to outside developers? Some easy APIs that allow anyone to put custom images and tags on maps, along with their own directions/routes, would be nice. I know I’m dreaming on that one…. I can’t imaging google’s mapping data providers (Navteq, Tele Atlas, ?) are too happy with google letting developers use their data for free. And, even if google did open it up to developers, you’d probably be under the similar 1000 hits/day restriction as their other web services. I wonder if they’d ever offer a commercial service…