inori/twitter-app-bundle
Composer 安装命令:
composer require inori/twitter-app-bundle
包简介
Clientless Twitter application instance to help automate project twitter updates
关键字:
README 文档
README
This project is no longer maintained by me. If you want to take over, please get in touch with me at inoryy@gmail.com
Introduction
TwitterAppBundle at its core is just a simple proxy bundle between twitteroauth client and symfony2. It is only meant to be used as a clientless app. If you want to add Twitter login/register/etc functionality to your app, please consider using FOS/TwitterBundle instead.
Example usage
Example use-case for this bundle would be automated twitter messages (from your project account) about certain events in your system.
Installation
With deps:
Add this bundle and Abraham Williams' Twitter library to your application:
[twitteroauth]
git=http://github.com/abraham/twitteroauth.git
[InoriTwitterAppBundle]
git=http://github.com/Inori/InoriTwitterAppBundle.git
target=bundles/Inori/TwitterAppBundle
With composer:
Add this bundle to your composer.json:
// composer.json
{
// ...
require: {
// ...
"inori/twitter-app-bundle": "master"
}
}
Register the namespace Inori to your project's autoloader bootstrap script:
//app/autoload.php
$loader->registerNamespaces(array(
// ...
'Inori' => __DIR__.'/../vendor/bundles',
// ...
));
Add this bundle to your application's kernel:
//app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Inori\TwitterAppBundle\InoriTwitterAppBundle(),
);
}
Configure the twitter_app service in your YAML configuration:
#app/config/config.yml
inori_twitter_app:
file: %kernel.root_dir%/../vendor/twitteroauth/twitteroauth/twitteroauth.php
consumer_key: xxxxxx
consumer_secret: xxxxxx
oauth_token: xxxxxx
oauth_token_secret: xxxxxx
NB! To learn how to get keys/tokens, take a look at Twitter Developers documentation. For a quick walkthrough check below.
Using TwitterApp
If the setup is done correctly, then you can start using TwitterApp like this:
// ...
$ta = $this->container->get('twitter_app');
$messages = $ta->getDirectMessages();
TwitterApp comes with some basic methods for easier usage (tweet, follow), but for most of the API features you should use twitteroauth via getApi() method like this:
// ...
$ta = $this->container->get('twitter_app');
$trends = $ta->getApi()->get('trends');
Getting Twitter API tokens
- Login at Twitter Developers page
- Create your application
- Go to your app profile page via My applications
- There you will see Consumer key and Consumer secret under OAuth settings
- Under Your access token you should see Access token and Access token secret, if not then simply press "Recreate my access token"
- Make sure Access level is Read, write, and direct messages, if not then then go to Settings tab and under Application Type -> Access choose Read, Write and Access direct messages
inori/twitter-app-bundle 适用场景与选型建议
inori/twitter-app-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.78k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2012 年 03 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「twitter」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 inori/twitter-app-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 inori/twitter-app-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 inori/twitter-app-bundle 相关的其它包
同方向 / 同关键字的高下载量 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.
A helper module for pdf-print, print and social share functionality based on bootstrap to custom modules.
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
统计信息
- 总下载量: 1.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-03-29