定制 unicodeveloper/laravel-feeder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

unicodeveloper/laravel-feeder

最新稳定版本:1.0.1

Composer 安装命令:

composer require unicodeveloper/laravel-feeder

包简介

Laravel 5 Package to extract atom and rss feeds from any website

README 文档

README

Latest Stable Version License Build Status Quality Score Total Downloads

Laravel 5 Package to extract atom and rss feeds from any website in a very good readable format

Installation

PHP 5.4+ or HHVM 3.3+, and Composer are required.

To get the latest version of Laravel Feeder, simply add the following line to the require block of your composer.json file.

"unicodeveloper/laravel-feeder": "1.1.*"

You'll then need to run composer install or composer update to download it and have the autoloader updated.

Once Laravel Feeder is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

  • Unicodeveloper\LaravelFeeder\LaravelFeederServiceProvider::class

You can also use a Facade

'aliases' => [
    ...
    'Feeder' => Unicodeveloper\LaravelFeeder\Facades\LaravelFeederFacade::class,
    ...
]

Configuration

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish --provider="Unicodeveloper\LaravelFeeder\LaravelFeederServiceProvider"

Usage

Download RSS feed from URL:

  $rss = Feeder::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 = Feeder::loadAtom($url);

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!

Don't forget to follow me on twitter!

Thanks! Prosper Otemuyiwa.

License

The MIT License (MIT). Please see License File for more information.

Security

If you discover any security related issues, please email prosperotemuyiwa@gmail.com instead of using the issue tracker.

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-04