Wikivoyage:RDF Expedition/RSS

From Wikivoyage
Jump to navigation Jump to search

RSS is a family of related protocols that lets people subscribe to "channels" or "feeds" of information. It's commonly used on the Web to keep let people organize, in one place, updates to their favorite blogs, wikis, news Web sites, or other regularly-updated information.

We currently have an RSS channel for English-language Wikivoyage based on the regularly-updated content on Wikivoyage (Project:Discover, Travel news, Project:Destination of the month, etc.). The feed depends on a long and fragile script that scrapes these articles directly.

It would be nice to have a way that users could design and organize RSS channels for English Wikivoyage and other Wikivoyage language versions without needing to program page-scrapers. Some possible examples:

As new features or content for Wikivoyage are developed, we could enhance or replace parts of the RSS feeds without extra programming. A single multipurpose RSS generator script (running nightly, say) could read info for all RSS feeds from pages on Wikivoyage, and output the RSS automatically. It could read a MediaWiki namespace article, like MediaWiki:rsschannels, to get the names of the articles with each feed to create. Then, each channel would have its own page, like Project:Community channel or Project:Readers channel. This would have some baked-in RDF code defining the channel properties, and links to articles that includes RDF code for the RSS items.

Representation

[edit]

RSS 1.0 is an RDF vocabulary for defining feeds. It's one of the three competing standards for RSS, and probably the least used, but it has the advantage of being implemented on top of RDF. Since most feed readers support all three standards, it should probably be fine to build this feature using RSS 1.0.

RSS 1.0 defines two kinds of things: RSS channels and RSS items. We can include the channel definition on the channel page, then one or more item definitions in each item page.

Examples

[edit]

The Turtle RDF for an RSS channel would look something like this:

    <http://wikivoyage.org/rss/en-news.rss>  a rss:Channel;
    rss:title "Wikivoyage News and Trivia";
    rss:link <http://en.wikivoyage.org/wiki/Main_Page>;
    rss:description "Travel news, trivia, and featured destinations from Wikivoyage, the free travel guide.".

For an RSS item, it would look something like this. Note that the item has to have a unique URI; I'm using a tag URI.

    <tag:wikitavel.org:en:2007:January:Destination-of-the-Month> a rss:item;
    rss:title "January 2007 Destination of the Month: Taipei";
    rss:link <http://en.wikivoyage.org/wiki/Taipei>;
    rss:description "Taipei is the provisional capital of the Republic of China, otherwise known as Taiwan. ...".

Templates

[edit]

It would make sense to wrap the RDF that defines an item in its own MediaWiki template Template:rssitem; similarly for channels Template:rsschannel. Then, a second layer of templates could use these RSS templates to make a page "RSS enabled". For example, Template:Newsitem could include the {{rssitem|...}} to add an RSS item for each news item without any work by the contributor.