Extension talk:RSS (GISWiki)/Archive 1

Atom problems
I'm having trouble using this with Atom. I'm using MagpieRSS 0.72, which says it has Atom support (since 0.61). However when I get the feeds, I only get the titles, no descriptions or summaries. It's as if the $short flag were always set to true.

My RSS hack
Cool Extension. I have to rewrite mine in GNU software. I was already planning on using Magpie. You guys are almost convincing me. Now all I need is some free time... Renmiri 06:48, 9 April 2006 (UTC)

external link
how to change the links for they are opened in a new page?

HTML Tags
How Do you Manage to dont let html tag appear? In my Wiki i get, full of html tags.

Wiki Output, Not HTML
I'm new to WikiPedia code but have tons of experience with Magpie and rendering RSS. I was sutmped why the code has HTML output and could only guess it was somehow enabled on the author's test site.

It was pretty easy to go in the code, and find all of the output.= statements to chenge them to wiki code.

example

if ($rssTitle !=='none') { if ($rssTitle=='') { $title= iconv($charset,$wgOutputEncoding,$rss->channel['title']); if ($rss->channel['link']) $title= "[".$rss->channel['link']." $title]"; $output = "=== $title ===\n"; }   else {     $title= "[".$rss->channel['link']." $rssTitle]"; $output="=== $title ===\n"; } } else { $output="\n\n\n"; }

if ($display) { $output.="* [$href $title]"; if ($text) $output.=" $text"; $output .= "\n"; }

if ($d_title ) $output.="* [$href $title]\n";

Change 'description' checks
There are a couple places in the code that try to check for a valid description like this: if($item[description])

This causes "index not found" errors if the RSS feed has a missing or empty description. The correct way to check this field is: if (array_key_exists('description',$item)) --Julie 01:37, 24 December 2006 (UTC)

Blogger Atom Hacks
To enable blogger atom feeds some tweaks are necessary to match the different formats:

Find the comment "# Bild items" and enter the following lines into the following foreach loop:

if (isset($item['atom_content'])) { $item['description'] =& $item['atom_content']; $item['date_timestamp'] = parse_w3cdtf($item['published']); }

Above the "# Bild items" comment there is another foreach loop. Place the following lines inside that loop right after the if statement.

if (isset($item['atom_content']) && $item['atom_content']) { $description = true; break; } --M2mtech 18:16, 6 January 2007 (UTC)

Truncate Description Text
Because we did not want to show the complete description we added the following function to truncate the text:

function mTruncate($string, $length = 200, $etc = ' ...') { if ($length == 0) return ''; $string = strip_tags($string); if (strlen($string) <= $length) return $string; $length -= strlen($etc); return substr(preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1)), 0, $length).$etc; }

To activate the truncate function we changed the following line

if ($text) $output.="\n$text";

to

if ($text) $output .= "\n". mTruncate($text);

--M2mtech 18:28, 6 January 2007 (UTC)

wfStrencode - RSS no working anymore in ver 1.9
RSS no longer working as of MediaWiki 1.9

I think the sfStrencode function was removed ( http://marc.theaimsgroup.com/?t=116650637100001&r=1&w=2 )

Error: Fatal error: Call to undefined function wfStrencode in C:\Inetpub\wwwroot\Sikhiwiki\extensions\rss.php on line 262


 * I confirm. Does someone have a solution ? --Eric larcher 23:51, 24 January 2007 (UTC)

Modification for version 1.9
if ($DisableCache) { global $wgVersion; $dbr =& wfGetDB( DB_SLAVE ); # Do not cache this wiki page. # for details see http://public.kitware.com/Wiki/User:Barre/MediaWiki/Extensions global $wgTitle, $wgDBprefix; $ts = mktime; $now = gmdate("YmdHis", $ts +120); $ns = $wgTitle->getNamespace; $ti = $dbr->addQuotes($wgTitle->getDBkey); $version = preg_replace("/^([1-9]).([1-9]).*/", "\\1\\2", $wgVersion); $sql = "UPDATE $wgDBprefix". "page SET page_touched='$now' WHERE page_namespace=$ns AND page_title=$ti"; $dbr->query($sql, __METHOD__); } --Wappler 16:06, 25 January 2007 (UTC)

Caching
Am I right in thinking that the feature here which defeats the cache only works if someone clicks on the page every 120 seconds? --67.166.97.61 20:14, 12 March 2007 (UTC)