home | web-mapping | data | scripts | bestiary | about | archive

Archive for the 'syndication [RSS, Atom, etc.]' Category

validate those feeds…

Sunday, January 21st, 2007

at Feed Validator, our new favorite website. The validator was written in Python, is open source, and can be run locally. The site also contains tutorials and the Atom 1.0, RSS 1.0, and RSS 2.0 specifications!

more information on RSS:

GeoRSS Wordpress Plugin

Wednesday, July 12th, 2006

I was thinking about creating a GeoRSS plugin for Wordpress, something that would allow one to tag posts with coordinates and then add the coordinates to the RSS feed in the proper format. Before I started, though, I realized somebody probably built it already. So I did a few Google searches and here's what I found:

The Geonames RSS to GeoRSS converter: A webservice that reads the entries of an RSS feed and searches the Geonames Database to find a location for the entry text. If a relevant location is found, its latitude and longitude are added to the RSS feed using the GeoRSS encoding.

[[ This seems like fun, but it's not what I'm looking for at the moment. ]]

Geo Plugin: Allows one to attach geographic coordinate information to posts. It also permits the specification of a default geographic location for the entire WordPress blog.

[[ Ok, this sounds like it will do at least half the job. … And it works great! Geo not only allows me to add ad hoc coordinates to a post, but it can also store locations! Perfect.]]

[[ … ]]

It appears that I'll have to hack wp-rss.php or wp-rss2.php to produce a GeoRSS feed. The Geo plugin provides some instructions on how to do this, but I'd prefer not touching these files (since my changes will get overwritten when I update).

GeoPress is pretty cool as well and promises a GeoRSS feed, but, again, I'll have to touch wp-rss.php or wp-rss2.php. Plus GeoPress seems a bit more robust than I want.

[[ … ]]

schiller labs is now GeoRSS compatible, using the GeoRSS GML encoding (the feed even validates). To make this happen, I had to tweak Geo a bit. So, if you want the GML encoding, you'll have to download the zip here. Decompress and install as usual.

Then add the following namespace declarations to the <rss> tag in wp-rss2.php:

  • xmlns:georss="http://www.georss.org/georss"
  • xmlns:gml="http://www.opengis.net/gml"

Finally add the following code inside the <item> tag:

<?php get_the_rss_geotags(); ?>

GeoRSS. Geographically Encoded Objects for RSS feeds

Thursday, June 22nd, 2006

oooh, a new standard. Encode location in an RSS feed using GeoRSS.

Easily parse using MagpieRSS:

$rssGeo = fetch_rss('http://www.geonames.org/recent-changes.xml');
foreach ($rssGeo->items as $arrItem) {
echo '<p><a href="' . $arrItem['link'] . '">' . $arrItem['title'] . '</a></p><p>' . $arrItem['description'] . '<br />';
foreach ($arrItem['georss'] as $key => $value) {
echo $key . '—' . $value;
}
echo '</p>';
}

View the above code in action.

Simple Classic ASP RSS 2.0 Reader

Wednesday, June 7th, 2006

We’ve just posted a simple Classic ASP RSS 2.0 Reader that is free to use, copy, and/or distribute.

At the moment, this reader is a little underpowered, since it only parses RSS 2.0 feeds, can’t handle podcasts, and doesn’t cache responses.

To use, simply copy and include the script in your project. At the location on the page where you’d like the output to appear, type:

<% Call rssReader(’feed url‘, number of items to display) %>

Any questions, feel free to contact us.

Parsing Podcasts with MagpieRSS

Wednesday, May 17th, 2006

MagpieRSS, my favorite RSS and Atom parser for PHP, doesn’t natively support the <enclosure> tag used in podcasts. This is because Magpie looks for values between an open and close tag and the enclosure is modeled with attributes:

<enclosure url="http://www.leipzig48.com/compositions/ghost/tistime.mp3" length="30720" type="audio/mpeg" />

The developer of Magpie is currently working on standardizing the handling of attributes, but, in the interim, there is a patch available to handle enclosures (thanks to Jude Venn and Mike Krus). This is good, because a podcast without an enclosure isn’t much of a podcast.

  1. Download the patched version of rss_parse.inc.
  2. Replace the current rss_parse.inc with the downloaded patch.
  3. Access the <enclosure> attributes in your script:

echo $arrItem[’enclosure’][0][’url’];
echo $arrItem[’enclosure’][0][’length’];
echo $arrItem[’enclosure’][0][’type’];

schiller labs is powered by wordpress . dev site and tool shed for emptystreets.net . valid xhtml . valid css