endroid/twitter

此包已被废弃,不再维护。未建议替代包。

Endroid Twitter

2.1.0 2019-03-30 09:44 UTC

README

endroid 提供

Latest Stable Version Build Status Total Downloads Monthly Downloads License

此库帮助向Twitter API发起请求。您需要的是可以在开发者控制台中找到的密钥。

安装

使用 Composer 安装此库。

$ composer require endroid/twitter

从Twitter获取消费者访问密钥和令牌

http://apps.twitter.com/app 上注册您的应用程序

使用方法

use Abraham\TwitterOAuth\TwitterOAuth;
use Endroid\Twitter\Client;

$twitterOAuth = new TwitterOAuth($consumerKey, $consumerSecret);
$client = new Client($twitterOAuth);

// Retrieve the last 50 items in the user's timeline
$tweets = $client->getTimeline(50);

// Or post a status message (with optional media)
$client->postStatus('Hello, this is my new status', ['/tmp/image1.png', '/tmp/image2.png']);

版本控制

版本号遵循MAJOR.MINOR.PATCH方案。向后兼容性破坏性变更将尽量减少,但请注意这些变更可能会发生。在生产环境中锁定依赖项,并在升级时测试您的代码。

许可

此包采用MIT许可。有关完整的版权和许可信息,请参阅与源代码一起分发的LICENSE文件。