Showing posts with label rss. Show all posts
Showing posts with label rss. Show all posts

Friday, October 12, 2007

What is RSS?

I noticed today that about 45% of subscribers to this blog use the e-mail subscription option instead of RSS. While e-mail is definitely a good way to be notified of updates to the blog I would suggest that you learn about RSS and how it might lighten your inbox load.

The best explanation I have found so far is a 3 minute video called RSS in Plain English (the website also has links to information in other languages).

One advantage of RSS over e-mail notification is that your inbox is not filled with update notifications at inconvenient times. Using RSS you go to your RSS page (or reader application) when you want to.

Thursday, August 2, 2007

Magik HTTP requests; Open Source Magik; Reading RSS

Brad packaged a new release (in .zip file) of the Magik Components source tree here. Be sure to choose the latest version of "mclib CST 4.0 SWAF". This will include the dialog designer that I mentioned yesterday.

I wanted to highlight one of the cool components that I have found in this package. The module is called :mclib_http_interface. It provides a Magik interface to making HTTP requests to a server and then return the results back to you as a simple_xml_document. You can then use the API on simple_xml_document to parse information out.

To highlight the ease and power of this capability, I quickly hacked together some code that allows you to connect to the Yahoo!Weather RSS feed and get a weather forecast for your location. This is a simple example and you can clearly extend it to your heart's content.

Download the Magik Components product and register the accompanying product.def file in your curent image.

Load the :mclib_http_interface module (eg., sw_module_manager.load_module(:mclib_http_interface)

Now run the following block of code. As written, it will give you a weather forecast for Boulder, CO, USA in degrees Celsius. The example also shows how you can glean lat/long information from a feed and convert it to a Magik coordinate.

_block
# see http://developer.yahoo.com/weather/ for more information
# about the Weather RSS feed
_constant BASE_URL << "http://weather.yahooapis.com/forecastrss"
_constant QUERY_CHAR << %?
_constant QUERY << "p=80305&u=c" # forecast for USA ZipCode 80305 in Celsius
_constant URL << write_string(BASE_URL,QUERY_CHAR,QUERY)

_local hr << mclib:http_request.new_for_url(_unset,_unset,URL)
_local response << hr.connect()
_local a_xml_doc << response.smart_result()

_local rss_channel << a_doc.top_element.element_matching_name(:channel)

_local item << rss_channel.element_matching_name(:item)

_local long << item.element_matching_name("geo:long").elements[1].as_number()
_local lat << item.element_matching_name("geo:lat").elements[1].as_number()

write()
write(item.element_matching_name(:title).elements[1]," at ",coordinate.new(long,lat))


_local forecast_attributes

_for a_forecast _over item.elements_matching_name("yweather:forecast")
_loop
forecast_attributes << a_forecast.attributes

write(forecast_attributes[:day]," (",forecast_attributes[:date],") ",forecast_attributes[:text]," low=",forecast_attributes[:low]," high=",forecast_attributes[:high]," ")
_endloop
_endblock
$


Incidentally, you can get more information about the Yahoo!Weather API at http://developer.yahoo.com/weather

Where I think this http_interface could come in really handy is for you to write GeoRSS parsers that would allow you to show location events on a Smallworld map (maybe as a SOM or a post_render_set). Have a look at Direction Magazine's Fun with GeoRSS article if you are interested in other ideas for interfacing with other data sources in real time from Smallworld.

Thursday, February 8, 2007

IAS, SOA and other TLAs

Much has been said about Smallworld moving to a Service Oriented Architecture (SOA). But what does it mean to you or your users. How can it benefit you and them?

The O'Reilly Radar Blog today posted a number of articles dealing with Yahoo! Pipes. The introductory article is Pipes and Filters for the Internet. It gives a very good description of what pipes are in terms of the web and RSS (another TLA).

What I found interesting was that the example used by the blog to demonstrate the power of pipes, GeoRSS and filters on the web was a classic GIS one:
A good example Pipe is "Apartment Near Something". It allows you to input what you would like to be near (for example: "parks"), what city (for example: "Palo Alto, CA"), and how far (for example: 2 miles). It outputs GeoRSS of available apartments in a Palo Alto, CA that are near parks.
The beauty of a tool like this is that your business analysts can put together dynamic queries of multiple data sources including your Smallworld data. You might also call this "roll your own dashboard". This might include applications that present power outage information, gas leaks or unserviced customers near your services taps.


If Smallworld has not included GeoRSS with their next version of IAS then I think it would be easy for someone else to write a GeoRSS service quite quickly to provide this service.

The Yahoo! Pipes graphical tool actually reminds me a bit about Safe Software's FME Workbench tool. It seems to me that if Safe would include a GeoRSS reader and various RSS manipulation transformers in its toolkit, then could provide a service that Yahoo! Pipes cannot: a RSS manipulation toolkit that resides behind a corporate firewall. A typical Smallworld customer has data that cannot or should not be exposed to the 'net. That means the Yahoo! Pipes tool cannot access it. But if FME had this capability, your business analysts could do the same thing in a secure environment.

In short, SOA is one way to get your data out to non-programmers and others that are more interested in the data than they are in the mechanisms/protocols for accessing that data. Yahoo! Pipes is a useful tool for that. If Safe could add this functionality to their toolkit, I would be even more excited!