Revision history for RSSHandler


Revision [23229]

Last edited on 2016-05-20 07:38:47 by DarTar [Replaces old-style internal links with new pipe-split links.]
Additions:
As of the latest release (1.1.6.1), Wikka has a quite limited [[RSS]] support, both as output and input. Before thinking of possible [[SyndicatingWikka | extensions]], we need to implement in a more consistent way the available RSS-related services.
>>As for **[[RSSInfo | RSS embedding]]**, which can be used to feed content to Wikka from external servers, we are switching to a new parser (like [[http://magpierss.sourceforge.net/ | Magpie]]): Magpie is less buggy and way more flexible than the current one (Onyx).
Download the ##[[http://mypapit.net/drop/files/feedcreator-1.7.2-ppt.zip | FeedCreator]]## class. Unzip the package and save the class in a comfortable location, e.g. ##3rdparty/plugins/feedcreator/feedcreator.class.php##.
Deletions:
As of the latest release (1.1.6.1), Wikka has a quite limited [[RSS]] support, both as output and input. Before thinking of possible [[SyndicatingWikka extensions]], we need to implement in a more consistent way the available RSS-related services.
>>As for **[[RSSInfo RSS embedding]]**, which can be used to feed content to Wikka from external servers, we are switching to a new parser (like [[http://magpierss.sourceforge.net/ Magpie]]): Magpie is less buggy and way more flexible than the current one (Onyx).
Download the ##[[http://mypapit.net/drop/files/feedcreator-1.7.2-ppt.zip FeedCreator]]## class. Unzip the package and save the class in a comfortable location, e.g. ##3rdparty/plugins/feedcreator/feedcreator.class.php##.


Revision [19211]

Edited on 2008-01-28 00:14:43 by DarTar [Modified links pointing to docs server]

No Differences

Revision [16990]

Edited on 2007-05-31 23:27:32 by DarTar [Reverted]
Additions:
Append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
==Validation==
~-**RSS 0.91** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS0.91" title="RSS 0.91"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**RSS 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS1.0" title="RSS 1.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**RSS 2.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS2.0" title="RSS 2.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**ATOM 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0" title="ATOM 1.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0" title="valid ATOM feed"><img src="images/icons/done.png" alt="√" /></a>""
==Changelog==
~-**##0.3.1##**
~~-dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. RSS 1.0 and Atom 1.0 accept an author without email;
~~-added feed image support;
~~-added css support;
~~-valid formats stored as CVS constant;
==To do==
~-add missing parameters;
~-add author/contributor elements;
~-create CSS/XSL for different formats;
~-move default settings to configuration file;
==The code==
Save the following code as ##handlers/page/feed.xml.php##
%%(php;1)
<?php
/**
* Creates a feed with recently changed pages
*
* This handler generates a list of recently changed pages on the current server. The output
* format can be specified in the URL.
*
* @package Handlers
* @name recentchanges.xml
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.3.1
* @access public
* @since wikka 1.1.X.X
* @uses wakka::config
* @uses FeedCreator (1.7.2-ppt)
* @todo - move defaults to wiki configuration files
*
* @input string $f optional: output format, can be any of the following:
* RSS0.91, RSS1.0, RSS2.0, ATOM1.0
* default: RSS2.0
* the default format can be overridden by providing a URL parameter 'f'.
* @output feed for recently changed pages in the specified format.
*/
//defaults
define('VALID_FORMATS', "RSS0.91,RSS1.0,RSS2.0,ATOM1.0");
define('DEFAULT_OUTPUT_FORMAT',"RSS2.0");
define('DESCRIPTION_TRUNCATE_SIZE',"500"); #character limit to truncate description
define('DESCRIPTION_HTML_SYNDICATE',"TRUE"); #Indicates whether the description field should be rendered in HTML
//stylesheets & images
define('FEED_CSS',"http://wikka.jsnx.com/css/xml.css");
define('IMAGE_URL',"http://wikka.jsnx.com/images/wikka_logo.jpg");
//i18n strings
define('FEED_TITLE',"%s - recently changed pages");
define('FEED_DESCRIPTION',"New and recently changed pages from %s");
define('IMAGE_TITLE',"Wikka logo");
define('IMAGE_DESCRIPTION',"Feed provided by Wikka");
//initialize variables
$f = '';
//get URL parameters
$formats = explode(",",VALID_FORMATS);
$f = (in_array($_GET['f'], $formats))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
//create objects
include_once($this->config['feedcreator_path'].'/feedcreator.class.php');
$rss = new UniversalFeedCreator();
$rss->useCached(); #make this configurable
$rss->title = sprintf(FEED_TITLE, $this->GetConfigValue("wakka_name"));
$rss->description = sprintf(FEED_DESCRIPTION, $this->GetConfigValue("wakka_name"));
$rss->cssStyleSheet = FEED_CSS;
$rss->descriptionTruncSize = DESCRIPTION_TRUNCATE_SIZE;
$rss->descriptionHtmlSyndicated = DESCRIPTION_HTML_SYNDICATE;
$rss->link = $this->GetConfigValue("base_url").$this->GetConfigValue("root_page");
$rss->syndicationURL = $this->Href($this->method,'','f='.$f);
//feed image
$image = new FeedImage();
$image->title = IMAGE_TITLE;
$image->url = IMAGE_URL;
$image->link = $this->GetConfigValue("base_url").$this->GetConfigValue("root_page");
$image->description = IMAGE_DESCRIPTION;
$image->descriptionTruncSize = DESCRIPTION_TRUNCATE_SIZE;
$image->descriptionHtmlSyndicated = DESCRIPTION_HTML_SYNDICATE;
$rss->image = $image;
//get feed items
if ($pages = $this->LoadRecentlyChanged())
{
$max = $this->GetConfigValue("xml_recent_changes");
$c = 0;
foreach ($pages as $page)
{
$c++;
if (($c <= $max) || !$max)
{
$item = new FeedItem();
$item->title = $this->GetConfigValue("wakka_name").' - '.$page['tag'];
$item->link = $this->Href("show", $page["tag"], "time=".urlencode($page["time"]));
$item->description = ($page['note'] ? ' - '.$page['note'] : '');
$item->date = date('r',strtotime($page['time']));
$item->source = $this->GetConfigValue("base_url");
if (($f == 'ATOM1.0' || $f == 'RSS1.0') && $this->LoadUser($page['user']))
{
$item->author = $page['user']; # RSS0.91 and RSS2.0 require authorEmail
}
$rss->addItem($item);
}
}
}
//print feed
echo $rss->createFeed($f);
?>
Feedback welcome
----
CategoryDevelopmentSyndication
Deletions:
Append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml


Revision [16789]

Edited on 2007-05-31 10:48:28 by WbxXsf [Reverted]
Additions:
Append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml
Deletions:
Append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
==Validation==
~-**RSS 0.91** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS0.91" title="RSS 0.91"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**RSS 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS1.0" title="RSS 1.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**RSS 2.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS2.0" title="RSS 2.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**ATOM 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0" title="ATOM 1.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0" title="valid ATOM feed"><img src="images/icons/done.png" alt="√" /></a>""
==Changelog==
~-**##0.3.1##**
~~-dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. RSS 1.0 and Atom 1.0 accept an author without email;
~~-added feed image support;
~~-added css support;
~~-valid formats stored as CVS constant;
==To do==
~-add missing parameters;
~-add author/contributor elements;
~-create CSS/XSL for different formats;
~-move default settings to configuration file;
==The code==
Save the following code as ##handlers/page/feed.xml.php##
%%(php;1)
<?php
/**
* Creates a feed with recently changed pages
*
* This handler generates a list of recently changed pages on the current server. The output
* format can be specified in the URL.
*
* @package Handlers
* @name recentchanges.xml
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.3.1
* @access public
* @since wikka 1.1.X.X
* @uses wakka::config
* @uses FeedCreator (1.7.2-ppt)
* @todo - move defaults to wiki configuration files
*
* @input string $f optional: output format, can be any of the following:
* RSS0.91, RSS1.0, RSS2.0, ATOM1.0
* default: RSS2.0
* the default format can be overridden by providing a URL parameter 'f'.
* @output feed for recently changed pages in the specified format.
*/
//defaults
define('VALID_FORMATS', "RSS0.91,RSS1.0,RSS2.0,ATOM1.0");
define('DEFAULT_OUTPUT_FORMAT',"RSS2.0");
define('DESCRIPTION_TRUNCATE_SIZE',"500"); #character limit to truncate description
define('DESCRIPTION_HTML_SYNDICATE',"TRUE"); #Indicates whether the description field should be rendered in HTML
//stylesheets & images
define('FEED_CSS',"http://wikka.jsnx.com/css/xml.css");
define('IMAGE_URL',"http://wikka.jsnx.com/images/wikka_logo.jpg");
//i18n strings
define('FEED_TITLE',"%s - recently changed pages");
define('FEED_DESCRIPTION',"New and recently changed pages from %s");
define('IMAGE_TITLE',"Wikka logo");
define('IMAGE_DESCRIPTION',"Feed provided by Wikka");
//initialize variables
$f = '';
//get URL parameters
$formats = explode(",",VALID_FORMATS);
$f = (in_array($_GET['f'], $formats))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
//create objects
include_once($this->config['feedcreator_path'].'/feedcreator.class.php');
$rss = new UniversalFeedCreator();
$rss->useCached(); #make this configurable
$rss->title = sprintf(FEED_TITLE, $this->GetConfigValue("wakka_name"));
$rss->description = sprintf(FEED_DESCRIPTION, $this->GetConfigValue("wakka_name"));
$rss->cssStyleSheet = FEED_CSS;
$rss->descriptionTruncSize = DESCRIPTION_TRUNCATE_SIZE;
$rss->descriptionHtmlSyndicated = DESCRIPTION_HTML_SYNDICATE;
$rss->link = $this->GetConfigValue("base_url").$this->GetConfigValue("root_page");
$rss->syndicationURL = $this->Href($this->method,'','f='.$f);
//feed image
$image = new FeedImage();
$image->title = IMAGE_TITLE;
$image->url = IMAGE_URL;
$image->link = $this->GetConfigValue("base_url").$this->GetConfigValue("root_page");
$image->description = IMAGE_DESCRIPTION;
$image->descriptionTruncSize = DESCRIPTION_TRUNCATE_SIZE;
$image->descriptionHtmlSyndicated = DESCRIPTION_HTML_SYNDICATE;
$rss->image = $image;
//get feed items
if ($pages = $this->LoadRecentlyChanged())
{
$max = $this->GetConfigValue("xml_recent_changes");
$c = 0;
foreach ($pages as $page)
{
$c++;
if (($c <= $max) || !$max)
{
$item = new FeedItem();
$item->title = $this->GetConfigValue("wakka_name").' - '.$page['tag'];
$item->link = $this->Href("show", $page["tag"], "time=".urlencode($page["time"]));
$item->description = ($page['note'] ? ' - '.$page['note'] : '');
$item->date = date('r',strtotime($page['time']));
$item->source = $this->GetConfigValue("base_url");
if (($f == 'ATOM1.0' || $f == 'RSS1.0') && $this->LoadUser($page['user']))
{
$item->author = $page['user']; # RSS0.91 and RSS2.0 require authorEmail
}
$rss->addItem($item);
}
}
}
//print feed
echo $rss->createFeed($f);
?>
Feedback welcome
----
CategoryDevelopmentSyndication


Revision [14830]

Edited on 2006-07-17 06:12:09 by DarTar [FeedCreator becomes a stand-alone project :)]
Additions:
One that looks quite promising is: [[http://feedcreator.org/]]
Deletions:
One that looks quite promising is: [[http://blog.mypapit.net/2005/11/using-feedcreator-to-generate-atom-10-feeds.html FeedCreator]] ([[http://www.bitfolge.de/rsscreator-en.html former project website]]).


Revision [12465]

Edited on 2005-12-28 10:36:30 by DarTar [adding link to new FeedCreator website]
Additions:
One that looks quite promising is: [[http://blog.mypapit.net/2005/11/using-feedcreator-to-generate-atom-10-feeds.html FeedCreator]] ([[http://www.bitfolge.de/rsscreator-en.html former project website]]).
Deletions:
One that looks quite promising is: [[http://www.bitfolge.de/rsscreator-en.html FeedCreator]]


Revision [12459]

Edited on 2005-12-27 15:18:46 by DarTar [minor]
Additions:
"feedcreator_path" => "3rdparty/plugins/feedcreator",
Deletions:
"feedcreator_path" => "3rdparty/core/feedcreator",


Revision [12458]

Edited on 2005-12-27 15:11:52 by DarTar [adding validation results]
Additions:
=== Test implementation: a new ##feed.xml.php## handler ===
==Usage==
==Validation==
==Changelog==
==To do==
==The code==
Deletions:
=== Test implementation ===
== Example: new ##feed.xml.php## handler ==
**Usage**
**Validation**
**Changelog**
**To do**
**The code**


Revision [12457]

Edited on 2005-12-27 15:04:48 by DarTar [adding validation results]
Additions:
This is a replacement for the current ##recentchanges## feed.
**The code**
Save the following code as ##handlers/page/feed.xml.php##
Deletions:
This is a replacement for the current ##recentchanges## feed. Save it as ##handlers/page/feed.xml.php##.


Revision [12456]

Edited on 2005-12-27 15:03:22 by DarTar [adding validation results]
Additions:
~~-dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. RSS 1.0 and Atom 1.0 accept an author without email;
~-add author/contributor elements;
Deletions:
~~-dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field. RSS 1.0 and Atom 1.0 accept an author without email;


Revision [12455]

Edited on 2005-12-27 15:02:12 by DarTar [adding validation results]
Additions:
== Example: new ##feed.xml.php## handler ==
**Usage**
Append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
Deletions:
== Example 1: new ##recentchanges.xml## handler ==
**Usage**: append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.


Revision [12454]

Edited on 2005-12-27 15:00:54 by DarTar [adding validation results]
Additions:
~-**##0.3.1##**
Deletions:
~-**##0.3.1##


Revision [12453]

Edited on 2005-12-27 15:00:30 by DarTar [adding validation results]
Additions:
**Validation**
~-**RSS 0.91** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS0.91" title="RSS 0.91"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**RSS 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS1.0" title="RSS 1.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**RSS 2.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS2.0" title="RSS 2.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0" title="valid RSS feed"><img src="images/icons/done.png" alt="√" /></a>""
~-**ATOM 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0" title="ATOM 1.0"><img src="images/xml.png" alt="XML icon" /></a> <a href="http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0" title="valid ATOM feed"><img src="images/icons/done.png" alt="√" /></a>""
**Changelog**
~-**##0.3.1##
~~-dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field. RSS 1.0 and Atom 1.0 accept an author without email;
~~-added feed image support;
~~-added css support;
~~-valid formats stored as CVS constant;
**To do**
~-add missing parameters;
~-create CSS/XSL for different formats;
~-move default settings to configuration file;
Deletions:
**Validation test**
~-**RSS 0.91** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS0.91" title="RSS 0.91"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91 valid]])
~-**RSS 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS1.0" title="RSS 1.0"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0 valid]])
~-**RSS 2.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS2.0" title="RSS 2.0"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0 valid]])
~-**ATOM 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0" title="ATOM 1.0"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0 valid]])
**Note** I've dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field. RSS 1.0 and Atom 1.0 accept an author without email.


Revision [12452]

Edited on 2005-12-27 14:49:52 by DarTar [adding validation results]
Additions:
~-**RSS 0.91** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS0.91" title="RSS 0.91"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91 valid]])
~-**RSS 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS1.0" title="RSS 1.0"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0 valid]])
~-**RSS 2.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=RSS2.0" title="RSS 2.0"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0 valid]])
~-**ATOM 1.0** --- ""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0" title="ATOM 1.0"><img src="images/xml.png" alt="XML icon" /></a>"" ([[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0 valid]])
Deletions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91 RSS0.91]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0 RSS1.0]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0 RSS2.0]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0 ATOM1.0]] {{done}}


Revision [12451]

Edited on 2005-12-27 14:26:08 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
**Note** I've dropped the author value for RSS 0.91 and 2.0 feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field. RSS 1.0 and Atom 1.0 accept an author without email.
Deletions:
**Note** I've dropped the author value for RSS feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field. Atom 1.0 allows an author without email.


Revision [12450]

Edited on 2005-12-27 14:07:05 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
* @version 0.3.1
define('VALID_FORMATS', "RSS0.91,RSS1.0,RSS2.0,ATOM1.0");
//stylesheets & images
define('FEED_CSS',"http://wikka.jsnx.com/css/xml.css");
define('IMAGE_URL',"http://wikka.jsnx.com/images/wikka_logo.jpg");
define('FEED_DESCRIPTION',"New and recently changed pages from %s");
define('IMAGE_TITLE',"Wikka logo");
define('IMAGE_DESCRIPTION',"Feed provided by Wikka");
//initialize variables
//get URL parameters
$formats = explode(",",VALID_FORMATS);
$f = (in_array($_GET['f'], $formats))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
//create objects
$rss->cssStyleSheet = FEED_CSS;
$rss->link = $this->GetConfigValue("base_url").$this->GetConfigValue("root_page");
//feed image
$image = new FeedImage();
$image->title = IMAGE_TITLE;
$image->url = IMAGE_URL;
$image->link = $this->GetConfigValue("base_url").$this->GetConfigValue("root_page");
$image->description = IMAGE_DESCRIPTION;
$image->descriptionTruncSize = DESCRIPTION_TRUNCATE_SIZE;
$image->descriptionHtmlSyndicated = DESCRIPTION_HTML_SYNDICATE;
$rss->image = $image;
//get feed items
$item->link = $this->Href("show", $page["tag"], "time=".urlencode($page["time"]));
$item->description = ($page['note'] ? ' - '.$page['note'] : '');
if (($f == 'ATOM1.0' || $f == 'RSS1.0') && $this->LoadUser($page['user']))
{
$item->author = $page['user']; # RSS0.91 and RSS2.0 require authorEmail
//print feed
?>
Deletions:
* @version 0.3
define('VALID_FORMATS', serialize(array("RSS0.91","RSS1.0","RSS2.0","ATOM1.0")));
define('FEED_DESCRIPTION',"A list of recently changed pages from %s");
// initialize variables
// get URL parameters
$f = (in_array($_GET['f'], unserialize(VALID_FORMATS)))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
// create object
$rss->link = $this->GetConfigValue("base_url");
$item->link = $this->GetConfigValue("base_url").$page['tag'];
$item->description = $page['time'].' by '.$page['user'].($page['note'] ? ' - '.$page['note'] : '');
if ($f == 'ATOM1.0')
{
$item->author = $page['user']; #Only Atom allows specifying an author without email
?>%%


Revision [12449]

Edited on 2005-12-27 10:53:02 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
**Usage**: append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
**Note** I've dropped the author value for RSS feeds, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field. Atom 1.0 allows an author without email.
* RSS0.91, RSS1.0, RSS2.0, ATOM1.0
define('VALID_FORMATS', serialize(array("RSS0.91","RSS1.0","RSS2.0","ATOM1.0")));
if ($f == 'ATOM1.0')
{
$item->author = $page['user']; #Only Atom allows specifying an author without email
}
Deletions:
**Usage**: append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM, ATOM0.3, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM ATOM]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM0.3 ATOM0.3]] {{done}}
**Note** I've dropped the author value, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field.
* RSS0.91, RSS1.0, RSS2.0, ATOM, ATOM0.3, ATOM1.0
define('VALID_FORMATS', serialize(array("RSS0.91","RSS1.0","RSS2.0","ATOM","ATOM0.3","ATOM1.0")));
//$item->author = $data['user']; requires an email


Revision [12448]

Edited on 2005-12-27 10:20:11 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
**Usage**: append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, ATOM, ATOM0.3, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91 RSS0.91]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0 RSS2.0]] {{done}}
**Note** I've dropped the author value, since if it's specified it must contain an email address, and we don't want to disclose user email addresses. The name of the wiki author is added in the description field.
* @version 0.3
* RSS0.91, RSS1.0, RSS2.0, ATOM, ATOM0.3, ATOM1.0
define('VALID_FORMATS', serialize(array("RSS0.91","RSS1.0","RSS2.0","ATOM","ATOM0.3","ATOM1.0")));
foreach ($pages as $page)
$item->title = $this->GetConfigValue("wakka_name").' - '.$page['tag'];
$item->link = $this->GetConfigValue("base_url").$page['tag'];
$item->description = $page['time'].' by '.$page['user'].($page['note'] ? ' - '.$page['note'] : '');
$item->date = date('r',strtotime($page['time']));
//$item->author = $data['user']; requires an email
Deletions:
**Usage**: append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, PIE0.1, OPML, ATOM, ATOM0.3, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91 RSS0.91]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0 RSS2.0]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DPIE0.1 PIE0.1]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DOPML OPML]] {{failed}}
As the above list shows, there are several validation problems. In particular, there is an issue with the Author field that apparently requires an email address for validating [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS2.0 RSS2.0]] and [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.9 RSS0.91]] feeds. Since we don't want every user's email to be disclosed, we could use the administrator email address, but I will investigate this further.
* @version 0.2
* - fix author validation issue
* RSS0.91,RSS1.0,RSS2.0,PIE0.1,OPML,ATOM,ATOM0.3,ATOM1.0
define('VALID_FORMATS', serialize(array("RSS0.91","RSS1.0","RSS2.0","PIE0.1","OPML","ATOM","ATOM0.3","ATOM1.0")));
foreach ($pages as $data)
$item->title = $this->GetConfigValue("wakka_name")." - ".$data['tag'];
$item->link = $this->GetConfigValue("base_url").$data['tag'];
$item->description = "History/revisions of ".$this->GetConfigValue("wakka_name")."/".$data['tag'];
$item->date = date("r",strtotime($data['time']));
$item->author = $data['user'];


Revision [12447]

Edited on 2005-12-27 09:39:47 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.91 RSS0.91]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS1.0 RSS1.0]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS2.0 RSS2.0]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DOPML OPML]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM ATOM]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM0.3 ATOM0.3]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DATOM1.0 ATOM1.0]] {{done}}
Deletions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS0.91 RSS0.91]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS1.0 RSS1.0]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS2.0 RSS2.0]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DOPML OPML]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DATOM ATOM]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DATOM0.3 ATOM0.3]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DATOM1.0 ATOM1.0]] {{done}}


Revision [12446]

Edited on 2005-12-27 09:20:28 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DPIE0.1 PIE0.1]] {{failed}}
Deletions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DPIE0.1 PIE0.1]] {{failed}}


Revision [12445]

Edited on 2005-12-27 09:04:27 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DPIE0.1 PIE0.1]] {{failed}}
Deletions:
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DPIE1.0 PIE1.0]] {{failed}}


Revision [12444]

Edited on 2005-12-27 09:03:28 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
Here's the feature list reported from its website:
Deletions:
Here's the features reported on its website:


Revision [12443]

Edited on 2005-12-27 08:58:59 by DarTar [adding ATOM 1.0 support and validation results]
Additions:
**Usage**: append ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml">/feed.xml</a>""## or ##""<a href="http://wikka.jsnx.com/RSSHandler/feed.xml?f=ATOM1.0">/feed.xml?f=FORMAT</a>""## (##/feed.xml&f=FORMAT## if mod_rewrite is disabled) to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, PIE0.1, OPML, ATOM, ATOM0.3, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
**Validation test**
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS0.91 RSS0.91]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS1.0 RSS1.0]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS2.0 RSS2.0]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DPIE1.0 PIE1.0]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DOPML OPML]] {{failed}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DATOM ATOM]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DATOM0.3 ATOM0.3]] {{done}}
~-[[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DATOM1.0 ATOM1.0]] {{done}}
As the above list shows, there are several validation problems. In particular, there is an issue with the Author field that apparently requires an email address for validating [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%253DRSS2.0 RSS2.0]] and [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikka.jsnx.com%2FRSSHandler%2Ffeed.xml%3Ff%3DRSS0.9 RSS0.91]] feeds. Since we don't want every user's email to be disclosed, we could use the administrator email address, but I will investigate this further.
Deletions:
**Usage**: append ##/feed.xml## or ##/feed.xml&f=FORMAT## to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, PIE0.1, OPML, ATOM, ATOM0.3, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
**Note:** There is an issue with the Author field that apparently requires an email address for validating [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fdartar.free.fr%2Frss_test%2F2.0.xml RSS2.0]] and [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fdartar.free.fr%2Frss_test%2F0.9.xml RSS0.91]] feeds. Since we don't want every user's email to be disclosed, we could use the administrator email address, but I will investigate further.


Revision [12442]

Edited on 2005-12-27 08:44:29 by DarTar [adding ATOM 1.0 support]
Additions:
Download the ##[[http://mypapit.net/drop/files/feedcreator-1.7.2-ppt.zip FeedCreator]]## class. Unzip the package and save the class in a comfortable location, e.g. ##3rdparty/plugins/feedcreator/feedcreator.class.php##.
**Usage**: append ##/feed.xml## or ##/feed.xml&f=FORMAT## to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, PIE0.1, OPML, ATOM, ATOM0.3, ATOM1.0##. If no format or an unknown format is specified, then ##RSS2.0## is used.
/**
* Creates a feed with recently changed pages
*
* This handler generates a list of recently changed pages on the current server. The output
* format can be specified in the URL.
*
* @package Handlers
* @name recentchanges.xml
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.2
* @access public
* @since wikka 1.1.X.X
* @uses wakka::config
* @uses FeedCreator (1.7.2-ppt)
* @todo - move defaults to wiki configuration files
* - fix author validation issue
*
* @input string $f optional: output format, can be any of the following:
* RSS0.91,RSS1.0,RSS2.0,PIE0.1,OPML,ATOM,ATOM0.3,ATOM1.0
* default: RSS2.0
* the default format can be overridden by providing a URL parameter 'f'.
* @output feed for recently changed pages in the specified format.
*/
define('VALID_FORMATS', serialize(array("RSS0.91","RSS1.0","RSS2.0","PIE0.1","OPML","ATOM","ATOM0.3","ATOM1.0")));
define('FEED_DESCRIPTION',"A list of recently changed pages from %s");
$f = (in_array($_GET['f'], unserialize(VALID_FORMATS)))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
$rss->syndicationURL = $this->Href($this->method,'','f='.$f);
?>%%
Deletions:
Download the ##[[http://www.bitfolge.de/download/feedcreator_172.zip FeedCreator]]## class. Unzip the package and save it in a comfortable location, e.g. ##3rdparty/plugins/feedcreator##.
**Usage**: append ##/feed.xml## or ##/feed.xml&f=FORMAT## to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, PIE0.1, OPML, ATOM, ATOM0.3##. If no format or an unknown format is specified, then ##RSS2.0## is used.
/**
* Creates a feed with recently changed pages
*
* This handler generates a list of recently changed pages on the current server. The output
* format can be specified in the URL.
*
* @package Handlers
* @name feed.xml
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.1
* @access public
* @since wikka 1.1.X.X
* @uses wakka::config
* @uses FeedCreator
* @todo - move defaults to wiki configuration files
* - fix author validation issue
*
* @input string $f optional: output format, can be any of the following:
* RSS0.91,RSS1.0,RSS2.0,PIE0.1,OPML,ATOM,ATOM0.3
* default: RSS2.0
* the default can be overridden by providing a URL parameter 'f'.
* @output feed for recently changed pages in the specified format.
*/
define('FEED_DESCRIPTION',"A list with recently changed pages from %s");
$f = ($_GET['f'] == ("RSS0.91" || "RSS1.0" || "RSS2.0" || "PIE0.1" || "OPML" || "ATOM" || "ATOM0.3"))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
$rss->syndicationURL = $this->GetConfigValue("base_url").$this->tag.'/'.$this->method;
?>


Revision [12441]

Edited on 2005-12-26 19:22:51 by DarTar [minor]
Additions:
This is a replacement for the current ##recentchanges## feed. Save it as ##handlers/page/feed.xml.php##.
**Note:** There is an issue with the Author field that apparently requires an email address for validating [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fdartar.free.fr%2Frss_test%2F2.0.xml RSS2.0]] and [[http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fdartar.free.fr%2Frss_test%2F0.9.xml RSS0.91]] feeds. Since we don't want every user's email to be disclosed, we could use the administrator email address, but I will investigate further.
* @name feed.xml
Deletions:
This is a replacement for the current ##recentchanges## feed. Save it as ##handlers/page/recentchanges2.xml##.
**Note:** There is a problematic issue with the Author field that requires an email address for creating valid RSS2.0 and RSS0.91 feeds. Since we don't want every user's email to be disclosed, we could use the administrator email address.
* @name recentchanges2.xml


Revision [12440]

Edited on 2005-12-26 18:11:59 by DarTar [posting first draft of flexible recentchanges feed]
Deletions:
::c::


Revision [12439]

Edited on 2005-12-26 18:11:10 by DarTar [posting first draft of flexible recentchanges feed]
Additions:
##""FeedCreator.class.php""## //provides an easy way to create RSS feeds from within PHP using ease to use classes.//
//Features:
~-creates valid feeds according to RSS 0.91, 1.0 or 2.0 as well as PIE 0.1 (deprecated), OPML 1.0, Unix mbox, ATOM 0.3, or customizable HTML or Javascript format.
~- configurable feed caching
~- very well documented and easy to use
~- feed image
~- includes almost all RSS 0.91 attributes
~- decide which version to create during runtime
~- easy to use and well documented class interface
~- intelligently truncates strings when needed
//
=== Test implementation ===
==Installation and setup==
Download the ##[[http://www.bitfolge.de/download/feedcreator_172.zip FeedCreator]]## class. Unzip the package and save it in a comfortable location, e.g. ##3rdparty/plugins/feedcreator##.
Add the following line to ##wikka.config.php##, immediately before the GeSHi related entries:
"feedcreator_path" => "3rdparty/core/feedcreator",
== Example 1: new ##recentchanges.xml## handler ==
This is a replacement for the current ##recentchanges## feed. Save it as ##handlers/page/recentchanges2.xml##.
**Usage**: append ##/feed.xml## or ##/feed.xml&f=FORMAT## to a page URL, where ##FORMAT## can be any of the following: ##RSS0.91, RSS1.0, RSS2.0, PIE0.1, OPML, ATOM, ATOM0.3##. If no format or an unknown format is specified, then ##RSS2.0## is used.
**Note:** There is a problematic issue with the Author field that requires an email address for creating valid RSS2.0 and RSS0.91 feeds. Since we don't want every user's email to be disclosed, we could use the administrator email address.
%%(php;1)
<?php
/**
* Creates a feed with recently changed pages
*
* This handler generates a list of recently changed pages on the current server. The output
* format can be specified in the URL.
*
* @package Handlers
* @name recentchanges2.xml
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.1
* @access public
* @since wikka 1.1.X.X
* @uses wakka::config
* @uses FeedCreator
* @todo - move defaults to wiki configuration files
* - fix author validation issue
*
* @input string $f optional: output format, can be any of the following:
* RSS0.91,RSS1.0,RSS2.0,PIE0.1,OPML,ATOM,ATOM0.3
* default: RSS2.0
* the default can be overridden by providing a URL parameter 'f'.
* @output feed for recently changed pages in the specified format.
*/
//defaults
define('DEFAULT_OUTPUT_FORMAT',"RSS2.0");
define('DESCRIPTION_TRUNCATE_SIZE',"500"); #character limit to truncate description
define('DESCRIPTION_HTML_SYNDICATE',"TRUE"); #Indicates whether the description field should be rendered in HTML
//i18n strings
define('FEED_DESCRIPTION',"A list with recently changed pages from %s");
define('FEED_TITLE',"%s - recently changed pages");
// initialize variables
$f = '';
// get URL parameters
$f = ($_GET['f'] == ("RSS0.91" || "RSS1.0" || "RSS2.0" || "PIE0.1" || "OPML" || "ATOM" || "ATOM0.3"))? $_GET['f'] : DEFAULT_OUTPUT_FORMAT;
// create object
include_once($this->config['feedcreator_path'].'/feedcreator.class.php');
$rss->useCached(); #make this configurable
$rss->title = sprintf(FEED_TITLE, $this->GetConfigValue("wakka_name"));
$rss->description = sprintf(FEED_DESCRIPTION, $this->GetConfigValue("wakka_name"));
$rss->descriptionTruncSize = DESCRIPTION_TRUNCATE_SIZE;
$rss->descriptionHtmlSyndicated = DESCRIPTION_HTML_SYNDICATE;
$rss->link = $this->GetConfigValue("base_url");
$rss->syndicationURL = $this->GetConfigValue("base_url").$this->tag.'/'.$this->method;
if ($pages = $this->LoadRecentlyChanged())
{
$max = $this->GetConfigValue("xml_recent_changes");
$c = 0;
foreach ($pages as $data)
{
$c++;
if (($c <= $max) || !$max)
{
$item = new FeedItem();
$item->title = $this->GetConfigValue("wakka_name")." - ".$data['tag'];
$item->link = $this->GetConfigValue("base_url").$data['tag'];
$item->description = "History/revisions of ".$this->GetConfigValue("wakka_name")."/".$data['tag'];
$item->date = date("r",strtotime($data['time']));
$item->source = $this->GetConfigValue("base_url");
$item->author = $data['user'];
$rss->addItem($item);
}
}
echo $rss->createFeed($f);
?>
Feedback welcome
Deletions:
FeedCreator.class.php provides an easy way to create RSS feeds from within PHP using ease to use classes.
Features:
- creates valid feeds according to RSS 0.91, 1.0 or 2.0 as well as PIE 0.1 (deprecated), OPML 1.0, Unix mbox, ATOM 0.3, or customizable HTML or Javascript format.
- configurable feed caching
- very well documented and easy to use
- Feed image
- includes almost all RSS 0.91 attributes
- decide which version to create during runtime
- easy to use and well documented class interface
- intelligently truncates strings when needed
Using the class is quite straightforward, here's an example from the website:
%%(php)
<?php
include("feedcreator.class.php");
$rss->useCached();
$rss->title = "PHP news";
$rss->description = "daily news from the PHP scripting world";
$rss->link = "http://www.dailyphp.net/news";
$rss->syndicationURL = "http://www.dailyphp.net/".$PHP_SELF;
$image = new FeedImage();
$image->title = "dailyphp.net logo";
$image->url = "http://www.dailyphp.net/images/logo.gif";
$image->link = "http://www.dailyphp.net";
$image->description = "Feed provided by dailyphp.net. Click to visit.";
$rss->image = $image;
// get your news items from somewhere, e.g. your database:
mysql_select_db($dbHost, $dbUser, $dbPass);
$res = mysql_query("SELECT * FROM news ORDER BY newsdate DESC");
while ($data = mysql_fetch_object($res)) {
$item = new FeedItem();
$item->title = $data->title;
$item->link = $data->url;
$item->description = $data->short;
$item->date = $data->newsdate;
$item->source = "http://www.dailyphp.net";
$item->author = "John Doe";

$rss->addItem($item);
$rss->saveFeed("RSS1.0", "news/feed.xml");
?>

How does this sound?


Revision [12437]

Edited on 2005-12-26 11:09:24 by DarTar [proposal for single feed generation class]
Additions:
Now, what we need to do is simply integrate such a class into Wikka and create a wrapper method to provide more flexibility and configurability. This will allow us to create //on the fly// new handlers for specific kinds of output and in multiple formats. The number and choice of formats to be displayed might be determined by Wiki Admins in the system configuration.
Deletions:
Now, what we need to do is simply integrate such a class into Wikka and create a wrapper method to provide more flexibility and configurability. This will allow us to create //on the fly// new handlers for specific kind of output and in multiple formats.


Revision [12436]

Edited on 2005-12-26 11:06:38 by DarTar [proposal for single feed generation class]
Additions:
Instead of manually fixing the current handlers, why not create some general feed generation utility that we can adapt to the specific kind of output to be produced? And instead of writing it ourselves and reinventing the wheel, why not simply write a wrapper around an existing feed generation class? There are many examples of light, flexible and GPL'ed PHP classes for feed generation that we could integrate with Wikka.
Deletions:
Instead of manually fixing the current handlers, why not create some general feed generation utility to be adapted to the specific kind of output to be produced? And instead of writing it ourselves and reinventing the wheel, why not simply write a wrapper around an existing feed generation class? There are many examples of light, flexible and GPL'ed PHP classes for feed generation that we could integrate with Wikka.


Revision [12435]

Edited on 2005-12-26 11:05:46 by DarTar [proposal for single feed generation class]

No Differences

Revision [12434]

Edited on 2005-12-26 11:04:27 by DarTar [proposal for single feed generation class]
Additions:
As of the latest release (1.1.6.1), Wikka has a quite limited [[RSS]] support, both as output and input. Before thinking of possible [[SyndicatingWikka extensions]], we need to implement in a more consistent way the available RSS-related services.
Deletions:
Wikka still has a quite limited [[RSS]] support, both as output and input. Before thinking of possible [[SyndicatingWikka extensions]], we need to implement in a more consistent way the available RSS-related services.


Revision [12432]

Edited on 2005-12-26 10:59:35 by DarTar [proposal for single feed generation class]
Additions:
>>**See also:**
~-JwRssTest
~-NewRssAction
>>As for **[[RSSInfo RSS embedding]]**, which can be used to feed content to Wikka from external servers, we are switching to a new parser (like [[http://magpierss.sourceforge.net/ Magpie]]): Magpie is less buggy and way more flexible than the current one (Onyx).
::c::
Deletions:
As for **[[RSSInfo RSS embedding]]**, which can be used to feed content to Wikka from external servers, we are switching to a new parser (like [[http://magpierss.sourceforge.net/ Magpie]]): Magpie is less buggy and way more flexible than the current one (Onyx).
[[NewRssAction more...]]


Revision [12431]

Edited on 2005-12-26 10:55:54 by DarTar [proposal for unique feed generation class]
Additions:
[[NewRssAction more...]]
Deletions:
[[NewRssAction more...]


Revision [12430]

The oldest known version of this page was created on 2005-12-26 10:55:37 by DarTar [proposal for unique feed generation class]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki