Extension:WikiArticleFeeds

From MediaWiki.org

Jump to: navigation, search

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
WikiArticleFeeds

Release status: beta

Implementation  Tag
Description Makes RSS/Atom feeds out of wiki articles.
Author(s)  Jim R. Wilson (Jimbojw)
Last Version  0.6.4
MediaWiki  1.6.x and higher
License The MIT License
Download Download snapshot

Subversion [Help]
Browse source code

Example  Blog - Trephine.org

check usage (experimental)

The WikiArticleFeeds Extension is a MediaWiki extension for converting regular wiki articles into RSS and Atom feeds.

Note: This is pretty much the polar opposite of XFeed

Please see the official project homepage for up-to-date installation notes, usage tips and advanced features.

Project Homepage
WikiArticleFeeds Extension - Jimbojw.com
Source Code
WikiArticleFeeds
Licensing
WikiArticleFeeds is released under The MIT License.

[edit] Installation

  1. Download WikiArticleFeeds, and be sure to rename the downloaded file to WikiArticleFeeds.php.
  2. Drop this script in $IP/extensions
    Note: $IP is your MediaWiki install dir.
  3. Enable the extension by adding this line to your LocalSettings.php:
    require_once('extensions/WikiArticleFeeds.php');
    

Configuration (optional)

If you'd like to disable the default link interpretation behavior (see the example), you can do so by adding this to your LocalSettings.php:

$wgForceArticleFeedSectionLinks = true;

[edit] Usage

Once installed, editors of your wiki may begin feeding pages immediately, no further system configuration is required.

The extension registers three tags:

  • <startFeed> (Required) - Denotes the beginning of an article segment containing feed data.
  • <endFeed> (Required) - Denotes the end of a feed data segment.
  • <feedBurner> (Optional) - Specifies that FeedBurner is to serve the feed, rather than publishing it directly.

If an article contains a feed section, links titled 'RSS' and 'Atom' will appear in the Toolbox. Additionally, because the appropriate <meta> tags are supplied, your browser may show a feed icon in the address bar.

Note: In the Monobook (default) skin, the Toolbox is in the left-hand sidebar column, towards the bottom.

As mentioned before, a feed section is delimited by the <startFeed /> and <endFeed /> flags. Note that these are CLOSED tags, and are functionally equivalent to <startFeed></startFeed> and <endFeed></endFeed> respectively.

The <feedBurner> tag, when specified, MUST HAVE a single attribute called 'name'. This is the final URL component of the feedburner.com feed URL. For example, consider the demo site:

http://jimbojw.com/wiki/index.php?title=Blog

The Atom feed URL for this page is:

http://jimbojw.com/wiki/index.php?title=Blog&action=feed

This has been mapped via feedburner.com to:

http://feeds.feedburner.com/Jimbojwcom-Blog

And thus, the following is added to the original article text to complete the circle:

<feedBurner name="Jimbojwcom-Blog" />

Note that using FeedBurner in this fashion does not prevent users from still trying to access the generated feeds directly, but it does change all the links to point to feedburner rather than back to the wiki.

[edit] Example

<startFeed />

Description of my feed.

=== Second Feed Item ===

Brand New! I just made a new Item!

--[[User:Anon|Anon]] 10:12, 8 December 2006 (MST)

=== First Feed Item ===

Here is the content for my first item ever.

--[[User:Anon|Anon]] 08:42, 4 December 2006 (MST)

<endFeed />

The description for the rendered RSS or Atom feed will be "Description of my feed." The feed will have two items, both authored by "User:Anon".

To add a new item, simply add a new wiki section between the startFeed and endFeed delimiters. Continuing the previous example:

<startFeed />

Description of my feed.

=== Third Item ===

When you get a chance, please check out the [[Main Page]].

--~~~~

=== Second Feed Item ===

Brand New! I just made a new Item!

--[[User:Anon|Anon]] 10:12, 8 December 2006 (MST)

=== First Feed Item ===

Here is the content for my first item ever.

--[[User:Anon|Anon]] 08:42, 4 December 2006 (MST)

<endFeed />

Feed item publication dates are determined automatically from standard wiki signatures, so in the above's "Third Item", the "--~~~~" results in a format which WikiArticleFeeds can parse (as in the first and second items).

Finally, the generated feed item URLs will be links to the matching page section, unless a link is made in the feed item text. In the above, the first two items would link to "[[#First Item]]" and "[[#Second Item]]", while the third would link to "[[Main Page]]".