Heim  >  Artikel  >  php教程  >  Zend Framework Feed

Zend Framework Feed

PHP中文网
PHP中文网Original
2016-05-25 17:13:111011Durchsuche

跳至

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;
    }
    
}


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn