Extension:WikiFeeds

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
WikiFeeds

Release status: stable

Implementation Special page
Description Enhanced feed support for MediaWiki
Author(s) Gregory Szorc
Last version 0.6 (2010-12-22)
MediaWiki 1.5.x, 1.6.x, 1.7.x, 1.8.x, 1.9.x
License No license specified
Download No link

Check usage (experimental)

The RSS and ATOM 0.3 feeds coming out of MediaWiki are not robust enough for all individuals. Hence the need for WikiFeeds. WikiFeeds is an alternative feed generator that outputs RSS 2.0 and ATOM 1.0 feeds. It can generate the following feeds:

  • Recent page changes
  • Newest pages
  • Recent changes by user
  • Newest pages by user
  • User watchlist (can be either public or private)
  • Recent changes for articles in a category
  • Recent changes for articles except changes made in selected category
  • Newest articles in a category
  • Newest articles except articles in selected category

WikiFeeds is present as a special page. It also inserts itself into the page view process and creates links to the available feeds. For example, when you are on a category page, the appropriate links to the per-category feeds are inserted into the HTML document for feed auto-discovery.

Contents

[edit] Demo

See http://wiki.case.edu/Special:WikiFeeds

[edit] Instructions

Most recent version of source code is available at http://opensource.case.edu/svn/MediaWikiHacks/extensions/WikiFeeds/trunk/SpecialWikiFeeds.php. (This URL seems to be down for good - try /SpecialWikiFeeds.php and /GenericXmlSyndicationFeed.php instead. No guarantee of being current.)

Installation directions are located in this source file.

Feeds can be accessed by visiting Special:WikiFeeds in your wiki. This page should show up on the special page list page.

WikiFeeds requires PHP 5 because it makes use of the PHP 5 class constants, the PHP 5 DOM functions, and the PHP SPL.

Newer versions of WikiFeeds have some of the class declarations split off in a separate file, GenericXMLSyndicationFeed.php. This file can be obtained at http://opensource.case.edu/svn/MediaWikiHacks/classes/GenericXmlSyndicationFeed/GenericXmlSyndicationFeed.php. It is recommended to use the most recent version of this file with WikiFeeds.

[edit] Unique Parameter

If you want use the unique parameter change the sql-query in line 545

replace

$sql = "SELECT rev_id AS revid, rev_page AS page, rev_user_text as user, rc_id AS rcid
      FROM $recentchanges, $revision
      WHERE rc_this_oldid=rev_id AND rev_deleted=0
      ORDER BY rev_id DESC LIMIT $count";

by

if ($unique == true) {
        $unique_sql = " AND rc_id=
                (SELECT MAX(rc_id) 
                FROM $recentchanges tmp 
                WHERE tmp.rc_cur_id=rc.rc_cur_id) ";
}
$sql = "SELECT rc_id, rev_id AS revid, rev_page AS page, rev_user_text as user, rc_id AS rcid 
        FROM $recentchanges rc, $revision 
        WHERE rc_this_oldid=rev_id AND rev_deleted=0 $unique_sql
        ORDER BY rev_id DESC LIMIT $count;";

[edit] Namespace Parameter

If you want to filter feeds by a namespace, add parameter /namespace/<namespace_name> or /namespace/<namespace_id> to URL.

[edit] Updates

  • Re-factored to a Special Page on March 22, 2006. (version 0.2)
  • Version 0.4 features a disk-based cache system and the ability to localize messages using the MediaWiki messages system
  • Version 0.5 has private watchlist feeds implemented as well as minor bug fixes.
  • Version 0.6 supports filtering by namespaces, has two new parameters and doesn't show changed articles with changes marked as minor in feeds. (all changes in code can be seen here: http://www.assembla.com/code/zcu-cz-wikifeeds/subversion/changesets/3)

[edit] Author

WikiFeeds is authored by Gregory Szorc. More information can be found at http://opensource.case.edu/projects/MediaWikiHacks. Modifications in version 0.6 made by Jenda Rybak for purpouses of http://support.zcu.cz (Univeristy of West Bohemia, Czech Rep.).

[edit] Sites using WikiFeeds

[edit] See also

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox