maalls/twitterapi
最新稳定版本:v1.2.5
Composer 安装命令:
composer require maalls/twitterapi
包简介
Implementation of the Twitter API for PHP.
README 文档
README
Simple Twitter API using OAuth 1.1, in PHP.
#Installation using Composer
Add the following line into the require section of your composer.json:
"require": { "maalls/TwitterApi": "~1.0" }
Then run the following command line:
$composer update
#Examples
use Maalls\TwitterApi; // A get request. $api = new TwitterApi($access_token, $access_token_secret, $consumer_key, $consumer_secret); $json = $api->get('search/tweets', array('q' => "github")); // A post request. $json = $api->>post("statuses/update", array("status" => "I love coding.")); // iterate() works for actions that returns an array of tweets: it collects all the tweets available by making several HTTP request and adjusting max_id parameters. // see https://dev.twitter.com/rest/public/timelines $json = $api->iterate('twitter/search', array('q' => 'githun'));
The class also collect the HTTP response header into an array, this is useful because it includes rate limit information:
var_dump($api->header); array(17) { [...] 'x-rate-limit-limit' => string(3) "180" 'x-rate-limit-remaining' => string(3) "179" 'x-rate-limit-reset' => string(10) "1416472112" [...] }
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-17