function simpleProcessFeed($feed = NULL, $target = 'newswire')
 {
     $importLog = PATH_SERVER_LOGS . 'import.log';
     // for bookmarks
     // process feed with simple pie
     require_once PATH_CORE . '/utilities/simplepie.inc';
     // Create a new instance of the SimplePie object
     $sp = new SimplePie();
     $sp->set_feed_url($feed->rss);
     $sp->set_cache_location(PATH_CACHE);
     $success = $sp->init();
     $sp->handle_content_type();
     if ($success) {
         echo '<h2>' . $sp->get_title() . '</h2><br />';
         // set up a feedTime as a backup for feeds without dates in them
         $spTime = time();
         $cnt = 0;
         // count headlines in feed
         foreach ($sp->get_items() as $item) {
             $spTime = $spTime - 60 * 15;
             // go fifteen minutes back for each feed item
             // clean up brand labels
             $itemTitle = $item->get_title();
             $itemDescription = $item->get_content();
             if ($author = $item->get_author()) {
                 $authorName = $author->get_name();
             } else {
                 $authorName = '';
             }
             // get the date
             $itemDate = $item->get_date('Y-m-d H:i:s');
             if ($itemDate == '') {
                 $itemDate = date('Y-m-d H:i:s', $spTime);
             }
             $itemLink = $item->get_permalink();
             // skip open threads
             if (stristr($itemTitle, 'open thread') === FALSE) {
                 switch ($target) {
                     case 'newswire':
                         $feedItem = $this->nwObj->serialize($itemTitle, $itemDescription, $feed->title, $itemLink, $itemDate, $feed->wireid, $feed->feedType, $feed->id);
                         // load into newswire table
                         $id = $this->nwObj->add($feedItem);
                         // returns false on duplicate
                         if ($id !== false) {
                             echo 'insert ' . $itemTitle . '<br>';
                             if ($enclosure = $item->get_enclosure()) {
                                 // look up thumbnail
                                 switch ($spNotes) {
                                     default:
                                         // look for default image url
                                         $mediaUrl = $this->db->safe($enclosure->link);
                                         $imageUrl = $this->db->safe($enclosure->get_thumbnail());
                                         $embed = $this->db->safe($enclosure->embed());
                                         print_r($mediaUrl);
                                         echo '<br />';
                                         print_r($imageUrl);
                                         echo '<br />';
                                         var_dump($embed);
                                         echo '<br />';
                                         $this->db->update("Newswire", "imageUrl='{$imageUrl}',mediaUrl='{$mediaUrl}',embed='{$embed}'", "id={$id}");
                                         break;
                                     case 'inlineImage':
                                         // feeds like Countdown that embed the thumbnail incorrectly
                                         $embed = $enclosure->native_embed();
                                         $link = $this->parseLink($embed);
                                         $this->db->update("Newswire", "imageUrl='{$link}'", "id={$id}");
                                         break;
                                 }
                             }
                             // for new items - check for loadOption
                             switch ($feed->loadOptions) {
                                 default:
                                     // none - do nothing
                                     break;
                                 case 'all':
                                     // add story to content table
                                     $this->loadStory($feedItem, $feed);
                                     break;
                                 case 'matches':
                                     // add story to content table if it matches one of our feeds
                                     if ($feed->feedType == 'bookmarks' and ($this->checkMatches($feedItem) or $this->checkKeywords($itemTitle, $itemDescription)) !== false) {
                                         $this->db->log('IMPORT:' . $itemTitle, $importLog);
                                         $this->loadStory($feedItem, $feed);
                                     } else {
                                         $this->db->log('No match:' . $itemTitle, $importLog);
                                     }
                                     break;
                             }
                         }
                         break;
                     case 'FeedMedia':
                         // flickr atom is rss where best image is in content
                         //							echo 'title '.$itemTitle.'<br>';
                         // strip img tags for medium pics from itemDescription
                         //							echo 'descrip <pre>'.$itemDescription.'</pre><br>';
                         $imgList = $this->_parsePageImages($itemDescription);
                         //							var_dump($imgList);
                         //							echo 'link:'.$itemLink.'<br>';
                         if ($enclosure = $item->get_enclosure()) {
                             // look up thumbnail
                             switch ($spNotes) {
                                 default:
                                     // look for default image url
                                     $mediaUrl = $this->db->safe($enclosure->link);
                                     $imageUrl = $this->db->safe($enclosure->get_thumbnail());
                                     $embed = $this->db->safe($enclosure->embed());
                                     //								         print_r($mediaUrl);
                                     //								         echo '<br />';
                                     //								         print_r($imageUrl);
                                     //								         echo '<br />';
                                     //								         var_dump ($embed);
                                     //								         echo '<br />';
                                     break;
                                 case 'inlineImage':
                                     // feeds like Countdown that embed the thumbnail incorrectly
                                     $embed = $enclosure->native_embed();
                                     $link = $this->parseLink($embed);
                                     break;
                             }
                         }
                         switch ($feed->specialType) {
                             case 'flickrContent':
                                 $fmTable = new FeedMediaTable($this->db);
                                 $m = $fmTable->getRowObject();
                                 $m->title = $itemTitle;
                                 $m->author = $authorName;
                                 $m->caption = nl2br(strip_tags($itemDescription));
                                 $m->previewImageUrl = $imgList[0]['src'];
                                 $m->linkUrl = $itemLink;
                                 $m->imageUrl = $mediaUrl;
                                 $m->numLikes = 0;
                                 $m->numComments = 0;
                                 $m->fbId = 0;
                                 $m->t = $itemDate;
                                 $m->mediaType = 'image';
                                 if (!$fmTable->isDup($m->linkUrl, $m->imageUrl) and $m->imageUrl != '') {
                                     switch ($feed->loadOptions) {
                                         default:
                                             if (!array_search($authorName, $this->authorList) or $authorName == '') {
                                                 // only use each flickr photographer/author once per fetch
                                                 $m->insert();
                                                 $this->authorList[] = $authorName;
                                             }
                                             break;
                                         case 'all':
                                             // load every image from this feed
                                             $m->insert();
                                             $this->authorList[] = $authorName;
                                             break;
                                     }
                                 }
                                 break;
                         }
                         break;
                 }
             }
             $cnt += 1;
             if ($cnt > 25) {
                 break;
             }
             // only do this many headlines
         }
     }
 }