Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-23-2008, 12:00 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Default Delete Items in object of Zend_Feed

Hi,

I am trying to manipulate a feed and filter items out, if the title contains certain text. But I don't know how to "unset" a item.

So here is how I try to do it.

After creating the feed just like in the example:
PHP Code:
$strFeed ''http://rss.mylinktosuperfeed";

// get the feed
try {
    
$spxRss Zend_Feed::import($strFeed);
} catch (
Zend_Feed_Exception $e) {
    
// Import des Feeds ist fehlgeschlagen
    
echo "Exception caught importing feed: {$e->getMessage()}\n";
    exit;

I try to iterate through the feed and check for the title and if it is matching my word it should be deleted in the feed

PHP Code:
foreach ($spxRss as $item) {
    if ( 
strpos(strtolower($item->title()), 'stringIdontWant') !== FALSE ) { 
         
$spxRss->offsetUnset($spxRss->key());
    }
}
echo 
$spxRss->saveXML(); 
I get the right key of the Item I want to delete in the feed, but it is not deleting it.

I'm probably doing this totally wrong.....can someone please help me?

Greetz

Last edited by Spankmaster79 : 04-23-2008 at 12:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:24 PM.