Forums

RSS problems (8 posts)

  1. barryprice
    Member
    Posted 5 years ago #

    Simply put, the fetch_rss() function is failing silently and I'm not sure how to find out why :-(

    The url 'http://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('http://ma.gnolia.com/rss/lite/people/barryprice');
    if ( isset($rss->items) && 0 != count($rss->items) )
    {
    print "yes";
    }
    else
    {
    print "no";
    }

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    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.

  3. barryprice
    Member
    Posted 5 years ago #

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

    Barry

  4. barryprice
    Member
    Posted 5 years ago #

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

    http://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.

  5. barryprice
    Member
    Posted 5 years ago #

    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...

  6. barryprice
    Member
    Posted 5 years ago #

  7. finalcut
    Member
    Posted 5 years ago #

    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.

  8. barryprice
    Member
    Posted 5 years ago #

    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:
    http://www.barryprice.co.uk/magnolia-plugin/

Topic Closed

This topic has been closed to new replies.

About this Topic