Magpierss

From Fxp Wiki

Jump to: navigation, search

Contents


Del.icio.us rss feeds in Mediawiki with Magpierss

The advantage of a system to have your links tagged instead of placed in a tree (folder) is that, exactly as on a wiki, the same link can be found on multiple places at once.

Les abonnements rss de Del.icio.us sur Mediawiki avec Magpierss

L'avantage de systèmes de tag pour les liens c'est qu'ils permettent, exactement comme pour les pages d'un wiki, d'avoir un lien apparaissant dans sous plusieurs références d'un seul coup.


Hack CategoryPage.php

After:

$r = $this->getCategoryTop() .
			$this->getSubcategorySection() .
			$this->getPagesSection() .
			$this->getImageSection() .
			$this->getCategoryBottom();

		wfProfileOut( __METHOD__ );

Insert this, and don't forget to change appropriately the line $rssUrl with the name of your Delicious profile instead of mine (fxparlant)

 
		//added FXP to allow del.icio.us feeds in category pages
		//require_once('extensions/magpierss/rss_fetch.inc');
		$rssUrl='http://del.icio.us/rss/fxparlant/'.$this->title->getDBkey();
		$rss = fetch_rss($rssUrl);
		$r .= "<h2> ". $rss->channel['title']. "</h2>\n";
foreach ($rss->items as $item ) {
	$titleRss = $item[title];
	$urlRss   = $item[link];
	//$r .= '<a href='.$url.'>'.$title.'</a></li><br>\n';
	$r .= "<a href=$urlRss>$titleRss</a><br />\n";
}
		//Iframe version not working in firefox who proposes different types of programms to read the feed instead of simply showing the links
		//$r .= '<iframe src ="http://del.icio.us/rss/fxparlant/'.$this->title->getText() .'" width="100%"></iframe>';
 
		return $r;

Modifiez CategoryPage.php

Après (environ ligne 88):

$r = $this->getCategoryTop() .
			$this->getSubcategorySection() .
			$this->getPagesSection() .
			$this->getImageSection() .
			$this->getCategoryBottom();

		wfProfileOut( __METHOD__ );

Insérez le paragraphe suivant sans oublier de remplacer "fxparlant" dans la ligne "$rssUrl" par le nom de votre profile sur Delicious.

 
		//added FXP to allow del.icio.us feeds in category pages
		//require_once('extensions/magpierss/rss_fetch.inc');
		$rssUrl='http://del.icio.us/rss/fxparlant/'.$this->title->getText();
		$rss = fetch_rss($rssUrl);
		$r .= "<h2> ". $rss->channel['title']. "</h2>\n";
foreach ($rss->items as $item ) {
	$titleRss = $item[title];
	$urlRss   = $item[link];
	//$r .= '<a href='.$url.'>'.$title.'</a></li><br>\n';
	$r .= "<a href=$urlRss>$titleRss</a><br />\n";
}
		//Iframe version not working in firefox who proposes different types of programms to read the feed instead of simply showing the links
		//$r .= '<iframe src ="http://del.icio.us/rss/fxparlant/'.$this->title->getText() .'" width="100%"></iframe>';
 
		return $r;


Change Magpie encoding

You will find in rss_fetch.inc and rss_parse.inc a few references to ISO-8859-1. Please do change them into UTF-8 to avoid weird characters in the feeds, especially if you are dealing with international content.

Modifier l'encodage de Magpie

Dans les fichiers rss_fetch.inc et rss_parse.inc, vous trouverez plusieurs références à ISO-8859-1 qu'il faut remplacer par UTF-8 afin d'éviter les mauvaise gestion des accents et autres caractères non anglo-saxons.

Personal tools