473,651 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Magpie RSS Rejects PHP generated RSS Feed

Can any see why Magpie RSS won't accept this RSS Feed (that is valid
according to the Feed Validator website).

http://www.westyorksprobation.org.uk...p?type=Library

This is the code that generates it. A SQL query is run first into
$result and then:

if (mysql_num_rows ($result)>0)
{
header("Content-Type: application/xml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\r\n";
echo " <rss version=\"2.0\" >\r\n";
echo "\r\n";
echo " <channel>\r\n ";
echo " <title>" . htmlspecialchar s($title) . "</title>\r\n";
echo " <link>".htmlspe cialchars("http ://
www.westyorkspr obation.org.uk/")."</link>\r\n";
echo " <description>RS S Feed for the " . htmlspecialchar s($title) .
"</description>\r\ n";
echo " <language>en-gb</language>\r\n";
echo " <lastBuildDate> " . date("D, d M Y H:i:s O",time()) . "</
lastBuildDate>\ r\n";
echo " <ttl>60</ttl>\r\n";
echo " <copyright>Copy right " . date("Y",time() ) . " West Yorkshire
Probation Board</copyright>\r\n" ;

while($resultsr ow=mysql_fetch_ row($result))
{
echo " <item>\r\n";
echo " <title>" . htmlspecialchar s($resultsrow[0]) . "</title>\r
\n";
echo " <description> " .
htmlspecialchar s(strip_tags(su bstr($resultsro w[1],0,500))) . "...</
description>\r\ n";
echo " <link>";
echo htmlspecialchar s("http://www.westyorkspr obation.org.uk/
library.php?act ion=accsearch&s tring=".$result srow[3]);
echo" </link>\r\n";
echo " <guid isPermaLink=\"t rue\">";

echo htmlspecialchar s("http://www.westyorkspr obation.org.uk/
library.php?act ion=accsearch&s tring=".$result srow[3]);

echo" </guid>\r\n";

echo " <pubDate>" . date("D, d M Y H:i:s
O",strtotime($r esultsrow[2])) . "</pubDate>\r\n";
echo " </item>\r\n";
echo "\r\n";
}
echo " </channel>\r\n";
echo " </rss>\r\n";
}
include("includ es/disconnect.php" );
exit;

Apr 11 '07 #1
8 2497
By the way, I have dug a bit further and the Magpie is reporting:
Failed to fetch http://www.westyorksprobation.org.uk...p?type=Library
(HTTP Response: HTTP/1.1 404)

But the file definitely exists...

Apr 11 '07 #2
*** Steve escribió/wrote (11 Apr 2007 13:26:09 -0700):
Can any see why Magpie RSS won't accept this RSS Feed (that is valid
according to the Feed Validator website).
What validator are you using? The W3C Validator warns about four errors:
This feed does not validate.

*

line 127, column 10: 'utf8' codec can't decode byte 0xa3 in position
5295: unexpected code byte (maybe a high-bit character?) [help]

Band 1 - ?12,658 - ?15,374<br />
^

*

line 4, column 62: XML parsing error: expecting ';' [help]

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
^

*

line 5, column 0: Undefined root element: xhtml:html [help]

<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">

*

line 59, column 63: XML parsing error: <unknown>:59:63 : not
well-formed (invalid token) [help]

<li><a
href="http://www.nprie.info/content.php?pn= 1019&feed=http% 3A%2F%2 ...
^

In addition, this feed has an issue that may cause problems for some users.
We recommend fixing this issue.

*

Feeds should not be served with the "text/html" media type [help]

http://validator.w3.org/feed/

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Apr 11 '07 #3
On 11 Apr, 21:52, "Alvaro G. Vicario" <webmas...@NOSP AMdemogracia.co m>
wrote:
What validator are you using? The W3C Validator warns about four errors:
Hi I am using

http://www.westyorksprobation.org.uk...p?type=Library

but just tried the W3C one and it validates without problems.

But like I say, Magpie Reports "404" error.

Apr 12 '07 #4
Steve wrote:
Can any see why Magpie RSS won't accept this RSS Feed (that is valid
according to the Feed Validator website).
http://www.westyorksprobation.org.uk...p?type=Library
Valid it may well be, but RSS it is certainly not. It's an XHTML file
without even a hint of RSSness.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 12 '07 #5
I think we must be looking at different files.

When I follow the link (http://www.westyorksprobation.org.uk/rss.php?
type=Library ) I definitely get an RSS XML file that validates
according to the W3C RSS Feed Validator.

If you get something different - could you dump the output into an
email and send it to me? I'm totally perplexed.

Many thanks.

Apr 12 '07 #6
Steve wrote:
When I follow the link (http://www.westyorksprobation.org.uk/rss.php?
type=Library ) I definitely get an RSS XML file that validates
according to the W3C RSS Feed Validator.
I must be going crazy, as it looks fine now. However, on a hunch, I tried:

http://www.westyorksprobation.org.uk...p?type=library

and that's the XHTML file I was looking at before!

I can't see anything *obviously* wrong with the feed (though indenting the
root element is not to my taste). Perhaps the problem is not with the feed
but with the code that's trying to parse it. Magpie RSS itself has always
seemed pretty reliable to me -- what about the script that's making use of
Magpie?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 12 '07 #7
*** Steve escribió/wrote (11 Apr 2007 13:51:42 -0700):
By the way, I have dug a bit further and the Magpie is reporting:
Failed to fetch http://www.westyorksprobation.org.uk...p?type=Library
(HTTP Response: HTTP/1.1 404)

But the file definitely exists...
Could Magpie's IP be blacklisted somewhere :-?
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Apr 12 '07 #8
VS
http://www.westyorksprobation.org.uk...p?type=library
I appear to get re-directed to the page at
http://www.westyorksprobation.org.uk/index.php

However:

http://www.westyorksprobation.org.uk...p?type=Library

looks ok.

(I have not checked the validity).

--
VS
Apr 12 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1865
by: ChronoFish | last post by:
Hello, Snoopy is reporting: Warning: MagpieRSS: Failed to fetch http://some.domain.com/atom.xml. (HTTP Response: HTTP/1.0 407 Proxy Authentication Required ) in \web\rss\magpie\rss_fetch.inc on line 230 When trying to get through a Squid proxy. I have set user, pass, proxy_host proxy_port, and is_proxy - yet I can't seem to get passed
5
1911
by: Mike Mella | last post by:
If I make an RSS feed of my site, am I expected to build and later update the RSS (XML) data by hand as I would any other webpage, or is there some process by which updates to a site are automatically incorporated into the RSS feed once the site itself is updated? Thanks. --Mella
0
1254
by: pyda001 | last post by:
I'm trying to read rss weather feeds, but am fairly new to this. Currently I've set up Magpie RSS to read the yahoo weather feeds. So far so good. The problem is that not all fields seem to be parsed. I'm particularly interested in the "<yweather ... />" field. It just isn't there. Could it be that Magpie ignores it? I believe it mainly seraches for <tag> </tag> fields and nothing else, but I'm not sure. What does the "/>" end of the tag...
6
3488
by: | last post by:
Hi, can someone provide some advise on how to get around with using auto generated proxies? basically I already have the proxy classes, and they are used by other places. I'd like use these existing classes instead of having to generate another set of proxy classes, which are going to be very similar to my existing classes. any idea? thanks, -Jason
4
1570
by: Carsten | last post by:
Hello, on my website I'm using the Drupal CMS. But I have a problem. All the output which is generated doesn't start at the first line (when you look at the source). All output starts at the third line. And that's not good for the XML which is generated through the FEED functions from the modules. Because the XML is not valid when the XML-tag doesn't start at the first line. Does anyone know of that? Maybe the htaccess-file ? I don't
3
4096
by: StevePBurgess | last post by:
Hi all, I am using Magpie RSS and want to change the Caching period to half an hour instead of one hour. I have modified the line in RSS_CACHE.INC so that it reads: var $MAX_AGE = 900; // when are files stale, default one hour
0
1825
by: StevePBurgess | last post by:
Hi I am using Magpie RSS and want to be able to use feeds on a secure server. I've put a test feed on https://www.on-qu.co.uk/feed88.xml At the command line, I can fetch this file using: curl -k https://www.on-qu.co.uk/feed88.xml But Magpie RSS can't fetch it and gives:
0
1264
by: musicpro64 | last post by:
I am having a problem calling more than one instance of the magpie rss code on a php page (one single instance can be used to display one feed... if I try to display two feeds on a page it crashes). Has anyone had success displaying more than one feed on a page with magpie???? if not, any suggestions as to code that might do the job..; I would really appreciate any advice. Have been fighting with this code for days! Thanks
3
2327
vikas1111
by: vikas1111 | last post by:
Hi All. I want to know how to alter Cache timing in Magpie. I tried to edit rss_cache.inc to 10 seconds but its not working. "var $MAX_AGE = 10; // when are files stale, default one hour" Can anyone kindly help me ?
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.