Created
May 2, 2009 06:15
-
-
Save halka/105438 to your computer and use it in GitHub Desktop.
TwitterのAPIの残機を取得する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//TwitterのAPIの残機を取得する | |
require_once 'HTTP/Request.php'; | |
define('user','userid'); | |
define('pass','password'); | |
$apilim='http://twitter.com/account/rate_limit_status.json'; | |
$req=& new HTTP_Request($apilim); | |
$req->setBasicAuth(user,pass); | |
$req->sendRequest(); | |
$result=$req->getResponseBody(); | |
$xml=json_decode($result,true); | |
//var_dump($xml); | |
echo "のこり:".$xml['remaining_hits']."<br />\nリセット時間;".$xml['reset_time']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment