orweb/easy-last-tweet
Composer 安装命令:
composer require orweb/easy-last-tweet
包简介
Symfony 2 bundle to add quickly last tweets on your website
README 文档
README
Symfony 2 bundle to add quickly last tweets on your website, you can choose and change the screen name, override template and use your own template, this bundle reqiure dependency on abraham/twitteroauth bundle
Installation
prerequisites
when you install OrwebEasyLastTweetBundle for symfony, this dependency will be add :
https://github.com/abraham/twitteroauth
installation
- Add this bundle to your project in composer.json:
{
"require": {
"orweb/EasylastTweet": "^1.0",
}
}
- Install with composer
composer.phar require orweb/EasylastTweet
- Register the bundle
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new \Orweb\EasyLastTweetBundle\OrwebEasyLastTweetBundle(), ); // ... }
#configuration
##application twitter
first you must create an twitter application on https://apps.twitter.com/ ,and create a token (read permission)
##parameters
you must add your twitter api parameters in app/config/config.yml, the required parameters must be added like this :
# app/config/config.yml orweb_easy_last_tweet: twitter: consumer_key: "your_application_key" consumer_secret: "your_application_secret_key" token: "your_application_token" token_secret: "your_application_token_secret"
#Usage
##twig usage:
just add this render command in your twig template (in this example we display the last 3 tweets from the @lyfeor account) :
{% render path('orweb_easy_last_tweet', {screen: 'lyfeor', number: 3}) %}
##controller usage:
if you want to use it in a controller you can get an entity Array with this code:
<?php // src/controller/someController.php public function someAction() { $tweets = $this->get('orweb.twitter')->getLastTweets($screen, $number); // ... //if you want retweets and mention $tweets = $this->get('orweb.twitter')->getLastTweets($screen, $number, false, true,true); }
#Override template
if you want to custom the render (in a twig template usage), you cans specify the path of your override template in the app/config/config.yml :
##config
# app/config/config.yml orweb_easy_last_tweet: twitter: consumer_key: "your_application_key" consumer_secret: "your_application_secret_key" token: "your_application_token" token_secret: "your_application_token_secret" template: path: "path/of/custom/template/tweet.html.twig"
##template
you can use the "tweets" entities Array like this :
{% for tweet in tweets %}
<dl>
<dt>{{ tweet.getDate() }}</dt>
<dd>{{ tweet.getFormatText() | raw }}</dd>
</dl>
{% endfor %}
to see all the 'tweet' parameters open the Entity/Tweet.php
orweb/easy-last-tweet 适用场景与选型建议
orweb/easy-last-tweet 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Symfony 2 tweets twitter last tweets」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 orweb/easy-last-tweet 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 orweb/easy-last-tweet 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 orweb/easy-last-tweet 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
Simple Twitter API wrapper
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
The bundle for easy using json-rpc api on your project
Bundle Symfony DaplosBundle
A helper module for pdf-print, print and social share functionality based on bootstrap to custom modules.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-21