• Simply put, the fetch_rss() function is failing silently and I’m not sure how to find out why ??

    The url ‘https://ma.gnolia.com/rss/lite/people/barryprice’ is an RSS feed of my latest links on ma.gnolia.com (like del.icio.us but different ??

    The following code prints “no”, which is a surprise because the feed parses fine with other methods, eg. PHP5’s DOM parser. I need to get this working on a PHP4 server though – any ideas?

    require_once(ABSPATH . WPINC . '/rss-functions.php');
    $rss = fetch_rss('https://ma.gnolia.com/rss/lite/people/barryprice');
    if ( isset($rss->items) && 0 != count($rss->items) )
    {
    print "yes";
    }
    else
    {
    print "no";
    }

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Okay, here’s the problems I found when I tried it…

    First, that RSS feed doesn’t validate. Bad dates, weird stuff on the description, invalid email address. Might get them to fix that.

    Secondly, the feed isn’t being retrieved by the Snoopy http client at all. The server returns a 301 Moved Permanently response, with a location of the exact same URI. I don’t have the slightest clue why it does this. I tried changing user agents, nothing. It doesn’t happen with a browser or with wget, but with Snoopy it does and I have no idea why.

    Anyway, sorry that I don’t have a solution for you, but the problem is somewhere in the interaction between this webserver and the Snoopy HTTP client. I can’t explain it.

    Thread Starter barryprice

    (@barryprice)

    Thanks man, I’ll point it out to them.

    Barry

    Thread Starter barryprice

    (@barryprice)

    Hmm, the ATOM feed (https://ma.gnolia.com/atom/lite/people/barryprice) validates fine:

    https://feedvalidator.org/check.cgi?url=http%3A%2F%2Fma.gnolia.com%2Fatom%2Flite%2Fpeople%2Fbarryprice

    But I still get the same problem using it in the script. I don’t get a 301 in lynx or wget, I guess I need to figure out how to get Snoopy into debug mode ??

    Looks like the problem is in Snoopy rather than Magpie though – I wonder if I can retrieve the feed using php/curl and stuff it through Magpie manually… Hmm.

    Thread Starter barryprice

    (@barryprice)

    Okay, the problem IS with Snoopy.

    Snoopy sends an HTTP/1.0 request (as opposed to HTTP/1.1 which most apps now use), and gets a 301 redirect in return.

    Given that most HTTP clients can cope with 301 redirects, I suggest this is a bug (or perhaps “feature request”) for the Snoopy devs…

    Thread Starter barryprice

    (@barryprice)

    well technically the problem is with curl.

    the magpie stuff which uses snoopy which uses curl fails at reddit.com and mag.nolia – but at both for different reasons. You get a 500 error at reddit and a 301 at mag.nolia.

    lastRSS works for both – however it uses fopen. The problem with fopen is that some webhosts don’t allow it.

    Thread Starter barryprice

    (@barryprice)

    That explains a lot, lastRSS is the solution I chose in the end, unfortunately I had to choose between PHP5 being necessary, or fopen() being necessary. fopen() seems more prevalent.

    Plugin here:
    https://www.barryprice.co.uk/magnolia-plugin/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘RSS problems’ is closed to new replies.