使用TwitterAPI 1.1版本检索USER_时间线的最简单的PHP示例
// Create curl resource $ch = curl_init(); // Set url curl_setopt($ch, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/myscreenname.json?count=10"); // Return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $output contains the output string $output = curl_exec($ch); // Close curl resource to free up system resources curl_close($ch);if ($output) { $tweets = json_decode($output,true); foreach ($tweets as $tweet) { print_r($tweet); }}
"{"errors":[{"message":"Could not authenticate you","code":32}]}"