Although nowadays Israel Railways do not have a RSS Feeds service, the intend to introduce it in the next monthes.
We did not want our gadget not to support such an important feature, so we decided to prepare a RSS File with some news that are in Israel Railways site.
Feeds Presentation In The Gadget
The gadget present the three first RSS items (the most recent ones) in the "Last News" in the search tab.
For this purpose we use the iGoogle technology and parse the RSS with the _IG_FetchFeedAsJSON function. This is an asynchronuos function, thus an error in the feed (or an unexisting url) will not block the gadget loading, and since it is not the main functionallity of the gadget.
We give _IG_FetchFeedAsJSON two parameters: the RSS url and a callback function.
The callback function receives as parameter a feed object which manages the feed and it's items.
The feed object contains an items array Entries and each entry of the arrays contains an Item object from which we get the item title, publication date and link.
If the user is not interested in the news he can dynamically close the news by clicking the x .