Hi
The headlines-PlugIn has a problem with a famous
german newsticker.
The RDF-File: http://www.heise.de/newsticker/heise.rdf
Headlines doesn't show anything, IIRC the original
plugin-release had the same bug.
I have found that the headlines bug finds some feeds as rdf
1.0 when it should be xml.
For example
Slashdot says xml version 1.0 but it is identified as rss
1.0 ( RSS10 ) by the script.
I am not familiar the definitions and quite rusty on
regexps but it looks like the rss .91 is the correct match
for this type of feed.
I also see that the cache file monitoring is looking for
cache.xml and not the cache file in the cache dir.
I made the following changes to make it work with slashdot
and the others I tested ( FreshMeat, HollyWoodBitchSlap,
and TopInternetNewsheadlines ) but dont assume it will work
for all of them, you would have to check the rfc's for that.
comment out the line
$feedtype="RSS10";
by adding a Number sign ( hash for you brits ) like this
# JRB - This might break some others but does what I need
# $feedtype="RSS10";
and add a line right below it with the 091 tag like this
$feedtype="RSS091";
to get the proper cache file comment the line
$s = stat("cache.xml");
and make it
$s = stat($cache_file);
I was also getting an error if the headline feed was 0
bytes saying something like Warning: ... success
I fixed this by doing the following
# JRB - Fix 0 byte error and do a conditional write
# Note the addition of the @ in front of file, this
# supresses the warning on 0 byte results
# orig code - $page = implode ("", file ($headlinesurl));
$page = "";
$page_array = @file ($headlinesurl);
if ( sizeof($page_array) > 1 ) {
$page = join ("",$page_array);
fwrite (fopen ($cache_file,"w"), $page);
} else {
# Add a notice about the feed not being
# available
$page = "<rdf:RDF>\n<title>Sorry, " .
$xsitename . " feed is unavailable</title>\n" .
"<link>$url</link>\n" .
"</rdf:RDF>";
}
DISCLAIMER: I am just picking up php, there may be a
better, faster, easier way but I have not had time to look
into it yet.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=205007
I have found that the headlines bug finds some feeds as rdf
1.0 when it should be xml.
For example
Slashdot says xml version 1.0 but it is identified as rss
1.0 ( RSS10 ) by the script.
I am not familiar the definitions and quite rusty on
regexps but it looks like the rss .91 is the correct match
for this type of feed.
I also see that the cache file monitoring is looking for
cache.xml and not the cache file in the cache dir.
I made the following changes to make it work with slashdot
and the others I tested ( FreshMeat, HollyWoodBitchSlap,
and TopInternetNewsheadlines ) but dont assume it will work
for all of them, you would have to check the rfc's for that.
comment out the line
$feedtype="RSS10";
by adding a Number sign ( hash for you brits ) like this
# JRB - This might break some others but does what I need
# $feedtype="RSS10";
and add a line right below it with the 091 tag like this
$feedtype="RSS091";
to get the proper cache file comment the line
$s = stat("cache.xml");
and make it
$s = stat($cache_file);
I was also getting an error if the headline feed was 0
bytes saying something like Warning: ... success
I fixed this by doing the following
# JRB - Fix 0 byte error and do a conditional write
# Note the addition of the @ in front of file, this
# supresses the warning on 0 byte results
# orig code - $page = implode ("", file ($headlinesurl));
$page = "";
$page_array = @file ($headlinesurl);
if ( sizeof($page_array) > 1 ) {
$page = join ("",$page_array);
fwrite (fopen ($cache_file,"w"), $page);
} else {
# Add a notice about the feed not being
# available
$page = "<rdf:RDF>\n<title>Sorry, " .
$xsitename . " feed is unavailable</title>\n" .
"<link>$url</link>\n" .
"</rdf:RDF>";
}
DISCLAIMER: I am just picking up php, there may be a
better, faster, easier way but I have not had time to look
into it yet.