Boyd
Boyd

Reputation: 763

Zend feed_rss object returning empty title

I made an RSS reader using Zend's Zend_Feed_Rss object. It worked fine for me (with feed 1) but our tester found out that it wont return a title on feed 2 (see below).

  1. http://www.nu.nl/feeds/rss/algemeen.rss
  2. http://rss.slashdot.org/Slashdot/slashdotScience

     <?php
    
     //...
    
     if($setUp){
         try{
             $feed = Zend_Feed::import($this->options['feed_url']);
         }catch(Exception $e){
             $setUp = false;
             $this->view->errorMsg = $this->lang['wrongRss'];
         }
     }
    
     if($setUp){
         $this->view->feed = $feed;
         $wTitle = $feed->title();
         if($this->title != $wTitle){
             $this->title = $wTitle;
         }
     }
    
     //...
    
     ?>
    

Both $feed->title and $feed->title() do not work on feed 2.

Zend_Feed_Rss object doesn't have any other methods or properties to get the title from. Who knows whats going wrong?

Edit: Stupid of me to not properly check the rss feed. It's an rdf feed thats not working. The entries are fetched ok, so the only thing that's not working is the title. How can I get the title from the rdf feed? Zend's feed object only seems to support rss and Atom.

Upvotes: 0

Views: 119

Answers (1)

Lars
Lars

Reputation: 5799

You should use the appropriate get*()-Functions, e.g. getTitle() instead of the properties. See the manual for further examples or the API documentation.

Upvotes: 1

Related Questions