tomaj/feed-downloader
Composer 安装命令:
composer require tomaj/feed-downloader
包简介
Simple feed downloader.
关键字:
README 文档
README
Simple library for downloading various feed.
Requirements
Feed downloader requires PHP 5.3.0 or higher.
Instalation
The best way to install feed-downloader is using Composer:
$ composer require tomaj/feed-downloader
Usage
You can use feed-downloader to download rss and process data with your function
$downloader = new \Tomaj\FeedDownloader\Downloader\CurlDownloader(); $processor = new \Tomaj\FeedDownloader\Processor($downloader); $url = 'http://somerssfeed.xml'; $result = $processor->processFeed($url, new \Tomaj\FeedDownloader\Parser\RssParser(), function(\Tomaj\FeedDownloader\FeedItem $item) { // custom handling $item echo $item->getTitle() . "\n"; echo $item->getLink() . "\n"; echo $item->getDescription() . "\n"; echo $item->getGuid() . "\n"; echo $item->getPubDate() . "\n"; }); if ($result === \Tomaj\FeedDownloader\Processor::PARSE_ERROR) { // error in xml } elseif ($result === \Tomaj\FeedDownloader\Processor::DOWNLOAD_ERROR) { // error with downloading }
Todo
- Encodings conversions
- DateTime in FeedItem
- Unify url/link with one getter
- Change ungly parser with multiple ifset() methods
- CurlDownloader test
Repository http://github.com/tomaj/feed-downloader.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-09-02