Maison  >  Article  >  php教程  >  Zend Framework Feed

Zend Framework Feed

PHP中文网
PHP中文网original
2016-05-25 17:13:111003parcourir

跳至

rssreaderAction($allnewsUrl);
        $guideList = $this->rssreaderAction($guideUrl);
        $tList = $this->rssreaderAction($tUrl);
        $newcarList = $this->rssreaderAction($newcarUrl);
        $eList = $this->rssreaderAction($eUrl);
        $salesList = $this->rssreaderAction($salesUrl);
        $recallsList = $this->rssreaderAction($recallsUrl);
        $servicingList = $this->rssreaderAction($servicingUrl);
        $insuranceList = $this->rssreaderAction($insuranceUrl);
        $ultratuneList = $this->rssreaderAction($ultratuneUrl);
        $automotiveList = $this->rssreaderAction($automotiveUrl);
        $trafficList = $this->rssreaderAction($trafficUrl);
        $tireList = $this->rssreaderAction($tireUrl);
        $this->view->allnewsList = $allnewsList;
        $this->view->guideList = $guideList;
        $this->view->tList = $tList;
        $this->view->newcarList = $newcarList;
        $this->view->eList = $eList;
        $this->view->salesList = $salesList;
        $this->view->recallsList = $recallsList;
        $this->view->servicingList = $servicingList;
        $this->view->insuranceList = $insuranceList;
        $this->view->ultratuneList = $ultratuneList;
        $this->view->automotiveList = $automotiveList;
        $this->view->trafficList = $trafficList;
        $this->view->tireList = $tireList;
    }

    public function rssreaderAction($uri) {
        $rssArray = array();
        try {
            
            $rssreader = Zend_Feed::import($uri);
        } catch (Zend_Feed_Exception $e) {
            echo "导入Feed异常:$e->getMessage()\n";
            exit();
        }
        foreach ($rssreader->items as $item) {
            $rssArray[] = array(
            'title' => $item->title(),
            'link' => $item->link(),
            'description' => $item->description(),
        );
        }
        return $rssArray;
    }
    
}


Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn