mhrlab/youtube-rss
Composer 安装命令:
composer require mhrlab/youtube-rss
包简介
Small and easy-to-use library for consuming YouTube feeds
README 文档
README
Small and easy-to-use library for consuming YouTube feeds
Installation
To install YouTube-Rss, simply:
composer require mhrlab/youtube-rss
For latest commit version:
composer require mhrlab/youtube-rss:dev-master
Requirements
YouTube-Rss works with PHP 7.0, 7.1, 7.2, 7.3, 7.4, and 8.0.
Quick Start and Examples
More examples are available under /examples.
require 'vendor/autoload.php'; $rss = new Feed('https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID'); if ($rss->error){ /* print error message */ echo $rss->errorMessage; }else{ $array = $rss->toArray(); /*pass true to print json with header('content-type:application/json')*/ $rss->toJSON(true); }
require 'vendor/autoload.php'; $rss = new Feed(); /*set time_zone to receive all time&date in own timezone. */ $rss->time_zone = 'asia/kolkata'; $rss->loadRss('https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID'); if ($rss->error){ /* print error message */ echo $rss->errorMessage; }else{ $array = $rss->toArray(); /*pass true to print json with header('content-type:application/json')*/ $rss->toJSON(true); }
Contribute
- Check for open issues or open a new issue to start a discussion around a bug or feature.
- Fork the repository on GitHub to start making your changes.
- Write one or more tests for the new feature or that expose the bug.
- Make code changes to implement the feature or fix the bug.
- Send a pull request to get your changes merged and published.
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-04