Content added Content deleted
imported>DrOwl (copy from muts media wiki) |
imported>DrOwl (→Source) |
||
Line 23: | Line 23: | ||
<pre> |
<pre> |
||
<?php |
<?php |
||
# |
# Figlet Mediawiki extension |
||
# using shell figlet |
|||
# using magpieRSS (http://magpierss.sourceforge.net/) |
|||
# by DrOwl 21.06.2005 |
|||
#modded from |
|||
# by mutante 25.03.2005 |
# by mutante 25.03.2005 |
||
⚫ | |||
require_once('magpierss-0.71.1/rss_fetch.inc'); |
|||
⚫ | |||
function |
function wffigletExtension() { |
||
global $wgParser; |
global $wgParser; |
||
$wgParser->setHook( "rss", " |
$wgParser->setHook( "rss", "renderFiglet" ); |
||
} |
} |
||
function |
function renderFiglet( $input ) { |
||
$input =~ /[Aa-Zz]|[1-0]; |
|||
# $input = mysql_escape_string($input); |
# $input = mysql_escape_string($input); |
||
$figlet = passthru('echo $input | /home/drowl/figlet/figlet -d /home/drowl/figlet/fonts'); |
|||
⚫ | |||
⚫ | |||
$rss = fetch_rss($input); |
|||
$output.="</pre>"; |
|||
$output="<table><tr><th>Channel Title: </th><th>" . $rss->channel['title'] . "</th></tr>"; |
|||
⚫ | |||
foreach ($rss->items as $item) { |
|||
$href = $item['link']; |
|||
$title = $item['title']; |
|||
$output.="<td colspan='2'><a href='$href'>$title</a></td></tr>"; |
|||
} |
|||
⚫ | |||
return $output; |
return $output; |
Revision as of 00:43, 21 May 2005
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 # Figlet Mediawiki extension # using shell figlet # by DrOwl 21.06.2005 #modded from # by mutante 25.03.2005 $wgExtensionFunctions[] = "wffigltExtension"; function wffigletExtension() { global $wgParser; $wgParser->setHook( "rss", "renderFiglet" ); } function renderFiglet( $input ) { $input =~ /[Aa-Zz]|[1-0]; # $input = mysql_escape_string($input); $figlet = passthru('echo $input | /home/drowl/figlet/figlet -d /home/drowl/figlet/fonts'); $output="<pre>"; $output.="$figlet"; $output.="
";
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)