moell/laravel-rss
Composer 安装命令:
composer require moell/laravel-rss
包简介
Based on moell/rss development laravel version
README 文档
README
Laravel package developed on the basis of moell/rss
RSS specification
http://www.rssboard.org/rss-specification
中文README
Requirement
Laravel 5+
Installation
composer require moell/laravel-rss:1.*
Modify config/app.php
#Append in providers Moell\LaravelRss\RssServiceProvider::class, #Append in aliases 'Rss' => Moell\LaravelRss\RssFacade::class,
Provides an interface
public function setEncode($encode); //默认UTF-8 public function channel(array $channel); public function item(array $item); public function items(array $items); public function build(); public function fastBuild(array $channel, array $item); public function __toString();
Usage
namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use Rss; class RssController extends Controller { public function index() { $channel = [ 'title' => 'title', 'link' => 'http://moell.cn', 'description' => 'description', 'category' => [ 'value' => 'html', 'attr' => [ 'domain' => 'http://www.moell.cn' ] ] ]; $rss = Rss::channel($channel); $items = []; for($i = 0; $i < 2; $i++) { $item = [ 'title' => "title".$i, 'description' => 'description', 'source' => [ 'value' => 'moell.cn', 'attr' => [ 'url' => 'http://www.moell.cn' ] ] ]; $items[] = $item; $rss->item($item); } return response($rss, 200, ['Content-Type' => 'text/xml']); //Other acquisition methods //return response($rss->build()->asXML(), 200, ['Content-Type' => 'text/xml']); //return response($rss->fastBuild($channel, $items)->asXML(), 200, ['Content-Type' => 'text/xml']); //return response($rss->channel($channel)->items($items)->build()->asXML(), 200, ['Content-Type' => 'text/xml']); } }
Generate results
<?xml version="1.0" encoding="UTF-8"?> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <channel> <title>title</title> <link>http://moell.cn</link> <description>description</description> <category domain="http://www.moell.cn">html</category> <item> <title>title0</title> <description>description</description> <source url="http://www.moell.cn">moell.cn</source> </item> <item> <title>title1</title> <description>description</description> <source url="http://www.moell.cn">moell.cn</source> </item> </channel> </rss>
License
MIT
moell/laravel-rss 适用场景与选型建议
moell/laravel-rss 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.46k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2016 年 10 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「rss」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 moell/laravel-rss 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 moell/laravel-rss 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 moell/laravel-rss 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Import an RSS-feed into blog
Alfabank REST API integration
RSS builder for Laravel
Small library for obtaining RSS feed with caching.
qscmf rss
GUI for managing news and RSS feeds
统计信息
- 总下载量: 1.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-03