phpmycoder/rss-php
Composer 安装命令:
composer require phpmycoder/rss-php
包简介
RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed.
README 文档
README
RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feeds.
It requires PHP 5.0 or newer with CURL extension or enabled allow_url_fopen and is licensed under the New BSD License. You can obtain the latest version from our GitHub repository or install it via Composer:
php composer.phar require dg/rss-php
Usage
Download RSS feed from URL:
$rss = Feed::loadRss($url);
The returned properties are SimpleXMLElement objects. Extracting the information from the channel is easy:
echo 'Title: ', $rss->title;
echo 'Description: ', $rss->description;
echo 'Link: ', $rss->link;
foreach ($rss->item as $item) {
echo 'Title: ', $item->title;
echo 'Link: ', $item->link;
echo 'Timestamp: ', $item->timestamp;
echo 'Description ', $item->description;
echo 'HTML encoded content: ', $item->{'content:encoded'};
}
Download Atom feed from URL:
$atom = Feed::loadAtom($url);
(c) David Grudl, 2008 (http://davidgrudl.com)
统计信息
- 总下载量: 51
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3
- 更新时间: 2014-02-24