Page 1 of 1

Debugging remoterss-plugin

Posted: Thu Jul 13, 2006 3:04 pm
by pilif
Hi there,

I have a strange problem with the remoterss-plugin ("Remote RSS/OPML-Blogroll Feed"). I wanted the plugin to work with

http://www.lipfi.ch/pilif.opml

and later I tried

http://www.lipfi.ch/pilif3.opml

too (no unicode byte order mark). Both files are generated from my newsgator-subscription list at http://services.newsgator.com/ngws/svc/ ... 1859&mid=1 (which I'm using with FeedDemon and Net News Wire).

Now, I'm seeing requests to the server, so the file is requested. In s9y's templates_c-directory, a cache file is created for the file, but it's always 0 bytes in size.

Consequently, the blogroll is empty afterwards.

I really want to debug this, so the question is: How? How can I get some insight / logging into the downloading/parsing routine? A quickly placed die() here and there didn't seem to have a visible effect so I guess the downloading and parsing of the feed is done somewhere in the background. Where?

Obviously I'd prefer a step-by-step solution telling me how to fix it (:wink:), but I'd already be very happy in some insight on when the download-routine is called and how I can interfer to get some logging out of it.

Thanks!

Philip

Posted: Thu Jul 13, 2006 3:27 pm
by pilif
Hi again,

ok. I found out what was going on. The problem indeed was the three bytes at the beginning of the feed. They caused xml_parse_into_struct() to bail out with a "no data" error.

Anyways. As I want to display only the 5 latest updated feeds in the OPML file, I'm going to write a little something that checks for the last update and then returns OPML with which xml_parse_into_struct() can work.

So consider this solved for me.

And these three bytes ARE the unicode byte order mark. Right? xml_parse_into_struct() should really be able to cope with that shouldn't it?

Philip

Posted: Thu Jul 13, 2006 4:28 pm
by garvinhicking
Hi!

Glad you found that out on your own :) It sounds interesting to have an option for the X latest item, if you make that configurable maybe you'd like to share your code/patch? :)
And these three bytes ARE the unicode byte order mark. Right? xml_parse_into_struct() should really be able to cope with that shouldn't it?
Definitely, yes. Which PHP version are you using?

Best regards,
Garvin

Posted: Fri Jul 14, 2006 1:21 pm
by pilif
Hi there,
garvinhicking wrote:Hi!
Glad you found that out on your own :) It sounds interesting to have an option for the X latest item, if you make that configurable maybe you'd like to share your code/patch? :)
What I did was to create a script which parses a OPML-file, visits the listed feeds, interprets them to get the date of when the last posting was added (using the Modified-Date-Header in the HTTP-protocol seemed unreliable), sorts the feeds by reverse date and finally outputs a OPML-file which I feed into the existing rss-plugin of s9y

I've blogged about the script. It's still a bit rough around the edges (no character set handling for example - it didn't matter for my all-english feeds), but it fullfills its purpose for me.
garvinhicking wrote:Hi!
And these three bytes ARE the unicode byte order mark. Right? xml_parse_into_struct() should really be able to cope with that shouldn't it?
Definitely, yes. Which PHP version are you using?
5.1.1 on Gentoo Linux. On another machine with 5.1.2 on Mac OS X I don't have the problem.

Philip