Revision history for JwRssTest


Revision [23214]

Last edited on 2016-05-20 07:38:47 by DarTar [Replaces old-style internal links with new pipe-split links.]
Additions:
[[http://diveintomark.org/archives/2004/02/04/incompatible-rss | The myth of RSS compatibility]]
Wikka uses a [[Docs:ThirdPartyInfo | third-party class]] called Onyx-RSS as its parser. It's lightweight, open source, capable of cacheing, and usually works just fine - but problems are cropping up more frequently, seemingly (maybe simply because more people are trying to use it). A major problem is that the package is no longer being maintained: either we fix it ourselves, or we look for a possible replacement.
The onyx-rss parser Wikka uses seems to have problems with it (at least the RSS 2.0 and Atom formats) but my (generally standards-insistent) [[http://www.hutteman.com/ | SharpReader]] feed reader does not grumble about any of them, which at least //suggests// they are all syntactically valid (it shows some interesting differences between the feeds though).
Let's see... There is always the [[http://feedvalidator.org/ | Feed Validator for Atom and RSS]] to tell us whether there is indeed any problem with a feed; I've found that if and when ""SharpReader"" reports a problem, the validator normally agrees. That experience is once again confirmed: **all four** feeds are valid according to the Feed Validator.
That's it. Neither ""SharpReader"" nor the [[http://feedvalidator.org/ | Feed Validator]] thinks that's a problem, but apparently Onyx-RSS thinks it is. At least that's all I can find, because there is no such thing as a "document" element, and nothing out of the ordinary at the reported lines.
Deletions:
[[http://diveintomark.org/archives/2004/02/04/incompatible-rss The myth of RSS compatibility]]
Wikka uses a [[Docs:ThirdPartyInfo third-party class]] called Onyx-RSS as its parser. It's lightweight, open source, capable of cacheing, and usually works just fine - but problems are cropping up more frequently, seemingly (maybe simply because more people are trying to use it). A major problem is that the package is no longer being maintained: either we fix it ourselves, or we look for a possible replacement.
The onyx-rss parser Wikka uses seems to have problems with it (at least the RSS 2.0 and Atom formats) but my (generally standards-insistent) [[http://www.hutteman.com/ SharpReader]] feed reader does not grumble about any of them, which at least //suggests// they are all syntactically valid (it shows some interesting differences between the feeds though).
Let's see... There is always the [[http://feedvalidator.org/ Feed Validator for Atom and RSS]] to tell us whether there is indeed any problem with a feed; I've found that if and when ""SharpReader"" reports a problem, the validator normally agrees. That experience is once again confirmed: **all four** feeds are valid according to the Feed Validator.
That's it. Neither ""SharpReader"" nor the [[http://feedvalidator.org/ Feed Validator]] thinks that's a problem, but apparently Onyx-RSS thinks it is. At least that's all I can find, because there is no such thing as a "document" element, and nothing out of the ordinary at the reported lines.


Revision [19181]

Edited on 2008-01-28 00:14:36 by DarTar [Modified links pointing to docs server]
Additions:
Wikka uses a [[Docs:ThirdPartyInfo third-party class]] called Onyx-RSS as its parser. It's lightweight, open source, capable of cacheing, and usually works just fine - but problems are cropping up more frequently, seemingly (maybe simply because more people are trying to use it). A major problem is that the package is no longer being maintained: either we fix it ourselves, or we look for a possible replacement.
Deletions:
Wikka uses a [[ThirdPartyInfo third-party class]] called Onyx-RSS as its parser. It's lightweight, open source, capable of cacheing, and usually works just fine - but problems are cropping up more frequently, seemingly (maybe simply because more people are trying to use it). A major problem is that the package is no longer being maintained: either we fix it ourselves, or we look for a possible replacement.


Revision [16938]

Edited on 2007-05-31 23:27:30 by DarTar [Reverted]
Additions:
if ((!$rss_path) && $wikka_vars) $rss_path = $wikka_vars;
$rss_path = $this->cleanUrl(trim($rss_path));
// override
if (preg_match("/^(http|https):\/\/([^\\s\"<>]+)$/i", $rss_path))
{
include_once('3rdparty/plugins/onyx-rss/onyx-rss.php');
if (!class_exists(Wikka_Onyx))
{
class Wikka_Onyx extends ONYX_RSS
{
//private function raiseError($line, $err)
function raiseError($line, $err)
{
if ($this->debugMode)
{
$errortext = sprintf($this->error, $line, $err);
echo '<!-- '.$errortext.' -->'."\n";
}
}
}
}
if (preg_match("/^(http|https):\/\/([^\\s\"<>]+)$/i", $rss_path))
{
if ($caching) {
// Create unique cache file name based on URL
$rss_cache_file = md5($rss_path).".xml";
}
//Load the RSS Feed
# include_once('3rdparty/plugins/onyx-rss/onyx-rss.php');
# $rss =& new ONYX_RSS();
# override workaround to hide error messages within HTML comments:
$rss =& new Wikka_Onyx();
$rss->setCachePath($rss_cache_path);
$rss->parse($rss_path, $rss_cache_file, $rss_cache_time);
$meta = $rss->getData(ONYX_META);
//List the feed's items
$cached_output = "<h3>".$meta['title']."</h3>";
$cached_output .= "<ul>\n";
while ($max_items > 0 && ($item = $rss->getNextItem()))
{
$cached_output .= "<li><a href=\"".$item['link']."\">".$item['title']."</a><br />\n";
$cached_output .= $item['description']."</li>\n";
$max_items = $max_items - 1;
}
$cached_output .= "</ul>\n";
echo $this->ReturnSafeHTML($cached_output);
} else {
# echo "<span class='error'><em>Error: Invalid RSS syntax. <br /> Proper usage: {{rss http://domain.com/feed.xml}} or {{rss url=\"http://domain.com/feed.xml\"}}</em></span>";
echo '<span class="error"><em>Error: Invalid RSS action syntax. <br /> Proper usage: {{rss http://domain.com/feed.xml}} or {{rss url="http://domain.com/feed.xml"}}</em></span>';
?>%%
''**This code is now implemented as a beta on this site!** Check the HTML source of this page to see the errors.''
CategoryDevelopmentActions CategoryDevelopmentTest CategoryDevelopmentSyndication
Deletions:
if ((!$rss_path)


Revision [16737]

Edited on 2007-05-31 10:43:01 by NdiKpj [Reverted]
Additions:
if ((!$rss_path)
Deletions:
if ((!$rss_path) && $wikka_vars) $rss_path = $wikka_vars;
$rss_path = $this->cleanUrl(trim($rss_path));
// override
if (preg_match("/^(http|https):\/\/([^\\s\"<>]+)$/i", $rss_path))
{
include_once('3rdparty/plugins/onyx-rss/onyx-rss.php');
if (!class_exists(Wikka_Onyx))
{
class Wikka_Onyx extends ONYX_RSS
{
//private function raiseError($line, $err)
function raiseError($line, $err)
{
if ($this->debugMode)
{
$errortext = sprintf($this->error, $line, $err);
echo '<!-- '.$errortext.' -->'."\n";
}
}
}
}
if (preg_match("/^(http|https):\/\/([^\\s\"<>]+)$/i", $rss_path))
{
if ($caching) {
// Create unique cache file name based on URL
$rss_cache_file = md5($rss_path).".xml";
}
//Load the RSS Feed
# include_once('3rdparty/plugins/onyx-rss/onyx-rss.php');
# $rss =& new ONYX_RSS();
# override workaround to hide error messages within HTML comments:
$rss =& new Wikka_Onyx();
$rss->setCachePath($rss_cache_path);
$rss->parse($rss_path, $rss_cache_file, $rss_cache_time);
$meta = $rss->getData(ONYX_META);
//List the feed's items
$cached_output = "<h3>".$meta['title']."</h3>";
$cached_output .= "<ul>\n";
while ($max_items > 0 && ($item = $rss->getNextItem()))
{
$cached_output .= "<li><a href=\"".$item['link']."\">".$item['title']."</a><br />\n";
$cached_output .= $item['description']."</li>\n";
$max_items = $max_items - 1;
}
$cached_output .= "</ul>\n";
echo $this->ReturnSafeHTML($cached_output);
} else {
# echo "<span class='error'><em>Error: Invalid RSS syntax. <br /> Proper usage: {{rss http://domain.com/feed.xml}} or {{rss url=\"http://domain.com/feed.xml\"}}</em></span>";
echo '<span class="error"><em>Error: Invalid RSS action syntax. <br /> Proper usage: {{rss http://domain.com/feed.xml}} or {{rss url="http://domain.com/feed.xml"}}</em></span>';
?>%%
''**This code is now implemented as a beta on this site!** Check the HTML source of this page to see the errors.''
CategoryDevelopmentActions CategoryDevelopmentTest CategoryDevelopmentSyndication


Revision [13479]

Edited on 2006-03-15 11:02:07 by DarTar [adding links]
Additions:
~-[[RSSHandler]]
Deletions:
~-RSSHandler


Revision [13476]

Edited on 2006-03-15 11:00:55 by DarTar [adding links]
Additions:
>>**See also**
~-RSSHandler
~-NewRSSAction
Required background reading:
Deletions:
>>Required background reading:


Revision [12425]

Edited on 2005-12-26 10:25:32 by DarTar [adding category link]
Additions:
CategoryDevelopmentActions CategoryDevelopmentTest CategoryDevelopmentSyndication
Deletions:
CategoryDevelopmentActions CategoryDevelopmentTest


Revision [11945]

Edited on 2005-11-22 22:18:49 by DarTar [adding svn link]
Additions:
{{svn}}


Revision [8669]

Edited on 2005-05-29 10:04:16 by JavaWoman [adding category]
Additions:
CategoryDevelopmentActions CategoryDevelopmentTest
Deletions:
CategoryDevelopmentActions


Revision [8590]

Edited on 2005-05-28 12:06:24 by JavaWoman [move to subcategory]
Additions:
CategoryDevelopmentActions
Deletions:
CategoryDevelopment


Revision [7925]

Edited on 2005-05-06 09:03:33 by JavaWoman [klugey workaround]
Additions:
===Preliminary workaround===
I've created a small override in the rss action file. What this does is instead of displaying any error raised, it embeds it in an HTML comment instead. Using this workaround action instead of the original, if you notice any strange behavior with a feed, just look at the **HTML source** of your page to find out if any error was reported - but at least it won't clutter up the page any more.
Far from ideal, I know, but it's the best I can come up quickly that prevents cluttering the output with useless errors but at the same time doesn't "lose" any actual errors. We'll find something better later... --JavaWoman
Here's the code:
**##/actions/rss.php##**
%%(php)
<?php
// Action usage:
// {{rss http://domain.com/feed.xml}} or {{rss url="http://domain.com/feed.xml" cachetime="30"}}
// NOTE1 : in Onyx-RSS default is "debugMode" which results in all errors being printed
// this could be suppressed by turning debug mode off, but then we'd never have a
// clue about the cause of any error.
// A better (preliminary) approach seems to be to override the raiseError() method
// still providing the text of any error message, only within an HTML comment:
// that way normal display will look clean but you can look at the HTML source to
// find the cause of any problem.
// NOTE 2: no solution for timeout problems with non-existing feeds yet...
$max_items = 30; // set this to the maximum items the RSS action should ever display
$caching = true; // change this to false to disable caching
$rss_cache_path = "/tmp"; // set this to a writable directory to store the cache files in
$lowest_cache_time_allowed = "5"; // set this to the lowest caching time allowed
$rss_cache_time = (int)trim($vars['cachetime']);
if (!$rss_cache_time) {
$rss_cache_time = 30; // set this for default cache time
} elseif ($rss_cache_time < $lowest_cache_time_allowed) {
$rss_cache_time = $lowest_cache_time_allowed;
}
$rss_cache_file = ""; // initial value, no need to ever change
//Action configuration
$rss_path = $vars['url'];
if ((!$rss_path) && $wikka_vars) $rss_path = $wikka_vars;
$rss_path = $this->cleanUrl(trim($rss_path));
// override
if (preg_match("/^(http|https):\/\/([^\\s\"<>]+)$/i", $rss_path))
{
include_once('3rdparty/plugins/onyx-rss/onyx-rss.php');
if (!class_exists(Wikka_Onyx))
{
class Wikka_Onyx extends ONYX_RSS
{
//private function raiseError($line, $err)
function raiseError($line, $err)
{
if ($this->debugMode)
{
$errortext = sprintf($this->error, $line, $err);
echo '<!-- '.$errortext.' -->'."\n";
}
}
}
}
}
if (preg_match("/^(http|https):\/\/([^\\s\"<>]+)$/i", $rss_path))
{
if ($caching) {
// Create unique cache file name based on URL
$rss_cache_file = md5($rss_path).".xml";
}
//Load the RSS Feed
# include_once('3rdparty/plugins/onyx-rss/onyx-rss.php');
# $rss =& new ONYX_RSS();
# override workaround to hide error messages within HTML comments:
$rss =& new Wikka_Onyx();
$rss->setCachePath($rss_cache_path);
$rss->parse($rss_path, $rss_cache_file, $rss_cache_time);
$meta = $rss->getData(ONYX_META);
//List the feed's items
$cached_output = "<h3>".$meta['title']."</h3>";
$cached_output .= "<ul>\n";
while ($max_items > 0 && ($item = $rss->getNextItem()))
{
$cached_output .= "<li><a href=\"".$item['link']."\">".$item['title']."</a><br />\n";
$cached_output .= $item['description']."</li>\n";
$max_items = $max_items - 1;
}
$cached_output .= "</ul>\n";
echo $this->ReturnSafeHTML($cached_output);
} else {
# echo "<span class='error'><em>Error: Invalid RSS syntax. <br /> Proper usage: {{rss http://domain.com/feed.xml}} or {{rss url=\"http://domain.com/feed.xml\"}}</em></span>";
echo '<span class="error"><em>Error: Invalid RSS action syntax. <br /> Proper usage: {{rss http://domain.com/feed.xml}} or {{rss url="http://domain.com/feed.xml"}}</em></span>';
}
?>%%
''**This code is now implemented as a beta on this site!** Check the HTML source of this page to see the errors.''


Revision [7923]

Edited on 2005-05-06 07:20:45 by JavaWoman [forgot a bit]
Additions:
Another interesting observation: while both the RSS 1.0 feed and the Atom feed incorporate author names for the items (and ""SharpReader"" displays these nicely), Onyx ignores them all.
Deletions:
Another interesting observation: while both the RSS 1.0 feed and the Atom feed incorporate author names for the items (and ""SharpReader"" displays these nicely).


Revision [7922]

Edited on 2005-05-06 06:55:12 by JavaWoman [replacement needed]
Additions:
>>WheelDog reports having problems integrating his students' blog via RSS in his Wikka site. When I first saw his results, it was the third time in a very few days that I saw nasty error messages from Onyx-RSS. (Another problem reported about Onyx was that for a no-longer-existing feed, Onyx will simply time out - after a long wait.) This page will serve to do a little analysis.
Another interesting observation: while both the RSS 1.0 feed and the Atom feed incorporate author names for the items (and ""SharpReader"" displays these nicely).
Time to look for a replacement, I think.
CategoryDevelopment
Deletions:
>>WheelDog reports having problems integrating his students' blog via RSS in his Wikka site. When I first saw his results, it was the third time in a very few days that I saw nasty error messages from Onyx-RSS. (Another problem reported about Onyx was that for a no-longer-existing feed, Onyx will simple time out.) This page will serve to do a little analysis.
Another interesting observation: while both the RSS 1.0 feed and the Atom feed incorporate author names for the items (and ""SharpReader"" displays these nicely)


Revision [7921]

Edited on 2005-05-06 06:50:00 by JavaWoman [the problem (I think)]
Additions:
What is it actually grumbling about here? This, apparently:
~-**RSS 0.92 feed**: there are **two** line feeds after the closing </rss> tag at line 57 (Onyx says 50)
~-**RSS 1.0 feed**: there is **one** line feed after the closing </rdf:RDF> tag at line 95 (Onyx says 87)
~-**RSS 2.0 feed**: there is **one** line feed after the closing </rss> tag at line 86 (Onyx says 77)
~-**RSS Atom feed**: there is **one** line feed after the closing </feed> tag at line 85 (Onyx says 77)
That's it. Neither ""SharpReader"" nor the [[http://feedvalidator.org/ Feed Validator]] thinks that's a problem, but apparently Onyx-RSS thinks it is. At least that's all I can find, because there is no such thing as a "document" element, and nothing out of the ordinary at the reported lines.
Another interesting observation: while both the RSS 1.0 feed and the Atom feed incorporate author names for the items (and ""SharpReader"" displays these nicely)
Deletions:
What is it actually grumbling about here? //More later.//


Revision [7920]

The oldest known version of this page was created on 2005-05-06 06:24:38 by JavaWoman [the problem (I think)]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki