×
Create a new article
Write your page title here:
We currently have 3,185 articles on s23. Type your article name above or click on one of the titles below and start writing!



s23
3,185Articles

Figlet Extension

Revision as of 00:33, 21 May 2005 by imported>DrOwl (copy from muts media wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Integrate RSS feeds into wiki pages using magpieRSS (a PHP RSS parser class) in a custom Mediawiki extension:

(For example to interwiki syndicate RecentChanges pages.)

mutante 20:57, 25 Mar 2005 (UTC)


Syntax

<rss>URL</rss>

Example

<rss>http://slashdot.org/slashdot.rss</rss>

Result

<rss>http://slashdot.org/slashdot.rss</rss>

(not installed on wikipedia, but here)

Source

<?php
# RSS-Feed Mediawiki extension
# using magpieRSS (http://magpierss.sourceforge.net/)
# by mutante 25.03.2005

require_once('magpierss-0.71.1/rss_fetch.inc');
$wgExtensionFunctions[] = "wfRssExtension";

function wfRssExtension() {
global $wgParser;
$wgParser->setHook( "rss", "renderRss" );
}


function renderRss( $input ) {

# $input = mysql_escape_string($input);


$rss = fetch_rss($input);

$output="<table><tr><th>Channel Title: </th><th>" . $rss->channel['title'] . "</th></tr>";
$output.="<tr><td>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$output.="<td colspan='2'><a href='$href'>$title</a></td></tr>";
}
$output.="</table>";

return $output;

}

?>

Improved Version by Duesentrieb

Also have a look at User:Duesentrieb/RSS for a modified version with a few more features -- Duesentrieb 01:29, 2 May 2005 (UTC)

This includes converting different charsets using iconv and an option to hide the description (shortened list). Thanks for your help , Duesentrieb, I didnt feel like messing with the charset conversion especially. mutante 22:31, 5 May 2005 (UTC)

Cookies help us deliver our services. By using our services, you agree to our use of cookies.