多くのレンタルサーバーで動く, Twitter REST API を叩くシンプルなPHPライブラリです.
一部のレンタルサーバーではallow_url_fopen
がOff
になっているので作成しました.
file_get_contents()
の代わりにcurl_exec()
によって接続を行います.
This is a simple PHP library for Twitter REST API.
Some rental servers do not allow allow_url_fopen
.
Because, this library uses curl_exec()
instead of file_get_contents()
.
config.php
に適当な値を設定し,下記のように呼び出します.
Update config.php
, and write like that:
$twitterAPI = new TwitterAPI();
$twitterAPI->request(
'GET', // method
'https://api.twitter.com/1.1/statuses/user_timeline.json', // url
array( // parameters
'screen_name' => '@_jyane',
'count' => 10
)
);
See also https://dev.twitter.com/rest/public.