You are not logged in.

Announcement

Support Has Moved!

SimplePie support has moved to Yahoo! Groups, and bug tracking has moved to bugs.simplepie.org. This support site will remain available as a read-only archive for the foreseeable future.

#1 1 July 2006 05:50:42

bm
SimplePie Superstar
Registered: 25 March 2006
Posts: 29

[RESOLVED] Feeds that don't seem to parse properly

The following feeds cannot be parsed on this page, which uses the PHP/SimplePie code described here. Using SimplePie beta 2 (Updated: 30 May 2006), SimplePie for WordPress 1.2, PHP 4.4.2

$myfeeds[] = "http://homepage.mac.com/icerabbit/websites/icerabbit/iblog";

No auto-discovery. It just doesn't show up. The actual feed URL is http://homepage.mac.com/icerabbit/websi … g/rss.xml. If I specify the actual feed I get the favicon, the title, then "Fatal error: Call to a member function on a non-object in /home/.ashea/bioneural/bioneural.net/wp-content/themes/k2bn/page-baking.php on line 80"

$myfeeds[] = "http://binarybonsai.com";

Nothing -- unless I specify the actual feed: http://binarybonsai.com/feed/atom/

$myfeeds[] = "http://andrewescobar.com";

Nothing -- unless I specify the actual feed: http://andrewescobar.com/feed/atom/

$myfeeds[] = "http://www.simplebits.com";

Using the domain or the actual feed URL (http://www.simplebits.com/xml/rss.xml) I get the favicon, the title, then "Fatal error: Call to a member function on a non-object in /home/.ashea/bioneural/bioneural.net/wp-content/themes/k2bn/page-baking.php on line 80"

$myfeeds[] = "http://www.hicksdesign.co.uk";

Using the domain or the actual feed URL (http://feeds.feedburner.com/hicksdesign) I get the favicon, the title, then "Fatal error: Call to a member function on a non-object in /home/.ashea/bioneural/bioneural.net/wp-content/themes/k2bn/page-baking.php on line 80"

$myfeeds[] = "http://www.stopdesign.com";

Using the domain or the actual feed URL (http://www.stopdesign.com/index.xml) I get the favicon, the title, then "Fatal error: Call to a member function on a non-object in /home/.ashea/bioneural/bioneural.net/wp-content/themes/k2bn/page-baking.php on line 80"

$myfeeds[] = "http://www.bensaunders.com";

Not picking up the item title.

$myfeeds[] = "http://www.bartelme.at";

Nothing -- unless I specify the actual feed (http://www.bartelme.at/rss.php) then I get the favicon, the title, then "Fatal error: Call to a member function on a non-object in /home/.ashea/bioneural/bioneural.net/wp-content/themes/k2bn/page-baking.php on line 80"

$myfeeds[] = "http://mezzoblue.com";

Using the domain or the actual feed URL (http://www.mezzoblue.com/rss/index.xml) I get the favicon, the title, then "Fatal error: Call to a member function on a non-object in /home/.ashea/bioneural/bioneural.net/wp-content/themes/k2bn/page-baking.php on line 80"

Offline

 

#2 10 July 2006 10:11:54

Skyzyx
Creator and Co-Developer
From: Silicon Valley, CA, USA
Registered: 30 January 2006
Posts: 1567
Website

Re: [RESOLVED] Feeds that don't seem to parse properly

Working on this.  I have a post mostly written on my other computer, so I'll get it posted ASAP.


SimplePie 1.0 | Trunk Demo | SimplePie Twitter | My Twitter | My LinkedIn

I'm currently working 2 full-time jobs, plus SimplePie. Responses will be lighter until February-ish 2008, but I expect to be available 1-2 times a week to answer questions. To get responses faster, try our IRC chat. irc://irc.freenode.net/simplepie. You must have an IRC client installed.

Offline

 

#3 16 August 2006 18:14:26

Skyzyx
Creator and Co-Developer
From: Silicon Valley, CA, USA
Registered: 30 January 2006
Posts: 1567
Website

Re: [RESOLVED] Feeds that don't seem to parse properly

Okay, I suck.  I know this took forever, and I'm sorry I lagged.  Anyways, here goes:

First off, if you already know the feed's url, it's faster if you just use that.  Doing so will save SimplePie the time it takes to dig around and find the feed in the first place.

Now, to the actual sites:

http://homepage.mac.com/icerabbit/websites/icerabbit/iblog:
The feed's URL is nowhere in the page.  That's why it can't be found. wink

http://binarybonsai.com:
The default feed for this site is the RSS feed.  It contains something in one of the URL's that's causing SimplePie to choke, Firefox and IE6 return an XML parsing error, and the Feed Validator is marking this feed as invalid.  The Atom feed doesn't seem to have this issue.

http://andrewescobar.com:
I'm not having any issues with this one.  Maybe a temporary quirk?

http://www.bensaunders.com:
It would appear that some posts have titles and some don't.

The rest of the sites that are all throwing the same error:
- http://homepage.mac.com/icerabbit/websi … bbit/iblog
- http://www.simplebits.com
- http://www.hicksdesign.co.uk
- http://www.stopdesign.com
- http://www.bartelme.at
- http://mezzoblue.com

None of these have authors associated with the individual blog postings.  We'll throw in some error-handling code for this as well.

Looking at the Baking v4 code from your most recent blog posting, we'll take a look at the for-loop where the actual parsing is happening:

Code:

<?php
for ($i=0; $i<10; $i++) { // Where 10 = number of posts to show
    $feed = new SimplePie($myfeeds[$i], $cache);

    if ($feed->data) {
        echo '<div class="sploop">';

        $max = $feed->get_item_quantity();
        if ($max > 0) {
            $item = $feed->get_item(0);
            $author = $item->get_author(0);

            echo '<span class="spfavicon"><a href="' . $feed->get_feed_link() . '">' . '<img src="' . $feed->get_feed_link() . '/favicon.ico" alt="X" width="16" height="16" />'. '</a></span>';
            echo '<span class="sptitle"><a rel="external" href="' . $item->get_permalink() . '">' . $item->get_title() . '</a></span>';
            if ($author) echo '<span class="spauthor">&mdash;By ' . $author->get_name() . '</span>';
            echo '<span class="spdate"> on ' . $item->get_date('j M Y') . '</span>';
        }

        echo '</div>'; // Close sploop
    }
    unset($feed);
}
?>

SimplePie 1.0 | Trunk Demo | SimplePie Twitter | My Twitter | My LinkedIn

I'm currently working 2 full-time jobs, plus SimplePie. Responses will be lighter until February-ish 2008, but I expect to be available 1-2 times a week to answer questions. To get responses faster, try our IRC chat. irc://irc.freenode.net/simplepie. You must have an IRC client installed.

Offline

 

#4 18 August 2006 01:42:14

bm
SimplePie Superstar
Registered: 25 March 2006
Posts: 29

Re: [RESOLVED] Feeds that don't seem to parse properly

Ryan that's great; all of my feeds are now behaving as they should. I've updated my "howto" page to refer to the new code. You rock!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson