Many city and local governments now make their crime statistics available on-line. This data is provided in a wide range of formats and with varying levels of detail. The city of Washington, D.C. maintains an XML file of their crime data. This example uses the Rename module to convert this XML into a valid RSS feed.
First, we fetch the XML crime data and pipe it into a Filter module. The Washington D.C. statistic include a lot of detail, including where the crime was committed (including latitude and longitude, though it's buried deep in the XML), and what type of crime. For our example, we'll just extract the bicycle thefts from the file by filtering on the item.content.dcst:ReportedCrime.dcst:method element.
Next, we pipe this subset of data into the Rename module. A valid RSS feed will have title, link, and description elements, so we write rules to rename appropriate XML elements to create these.
Since we have geolocation data buried in the XML, we'll also create two copy as rules to create top-level latidude and longitude elements. This let's us pipe the output into a Location Extractor module to create a y:location element.
When we run this pipe, the geographic data is recognized by Pipe Preview, and we see a map of all the bicycle thefts in Washington, D.C.
Pipe Web Address: http://pipes.yahoo.com/pipes_team/bPpcQ_FS3BGuG15j2h2EvQ