Extension talk:RSS (GISWiki)/Archive 1

RSS and DynamicPageList Clash
Hi, our wiki uses RSS and DynamicPageList extensions. There seems to be a problem when they are used on the same page though. An error occurs in the magpierss file that causes the formatting of the page to display the error at the top of the page, and then display the rest of the page. The error occurs on line 404 of the magpie rss_fetch.inc file. Is there a way to fix this?

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)
 * thank you --Nako 18:29, 16 March 2007 (UTC)
 * Works also fine for mediawiki 1.10. Thank you ! Lilious 14:41, 22 May 2007 (UTC)
 * Works fine for Mediawiki 1.11.0. Thankyou so much.

Modification for PostgreSQL
The above code doesn't work on Postgres because the timestamp format is incorrect. Here's a revised version that works on Postgres and Mediawiki 1.10:

This is probably a safer way to disable caching of pages on modern MediaWiki versions. --Dave 22:29, 23 June 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)

Blank Front Page
I am currently running the previous version of RSS with mediawiki 1.9 and it works fine, but I want the ability to not show titles. After installing this version (copied from extension page) and changing the variables in the script I get a blank front page. Return to the old version and it works again. Is there a problem with the new script or am I doing something wrong? Terrybritton 22:26, 5 April 2007 (UTC)

Warning dateexpects parameters 2 to be long, string given in /mnt/sites/mysitenamehere/web/wiki/extensions/rss.php on line 188
Hi,

Things were working fine and all of a sudden, after being out some days without checking the website, here is the error message I am getting when loading it.

Any idea as to where I should look?

Thanks!

Update: I'm quite positive this is due to a date problem, or the lack thereof, for if I use the Date tag it will show [] only

Guy

PS: the site is here: http://www.yonis.ch

MW 1.7 PHP 5.0 From Firefox 2.0 (same with IE 7)

Possible to combine multiple feeds?
Is it possible to have multiple feeds, and have the output combined in order of date, newest to oldest? E.g. this works: http://slashdot.org/slashdot.rss|charset=UTF-8|short|max=5 http://reddit.com/.rss|charset=UTF-8|short|max=5 ... but shows two different sections (does not combine their output) However this does not work at all: http://slashdot.org/slashdot.rss|charset=UTF-8|short|max=5 http://reddit.com/.rss|charset=UTF-8|short|max=5 (only shows the slashdot feed, reddit feed is ignored).

-- All the best, Nickj 02:34, 20 June 2007 (UTC)

Template:Description missing
What does this program do? There is no description at all. 68.93.142.153 06:19, 1 February 2008 (UTC)
 * At the top of the page (edit mode) there's the "Extension" template. Please simply add a description and/or other parts after the line

| description =
 * -- :Bdk: 06:23, 1 February 2008 (UTC)