我正在使用tmhoauth库来构建一个小型的Twitter应用程序演示。一切正常,如检索推文,搜索等。但当我尝试使用woeid检索趋势主题时,我得到一个404 - 此页面不存在错误。我尝试过不同的祸患。
如果有人能指出我做错了什么,我将不胜感激。
这是我的代码。
public function trends1(){
require 'tmhOAuth.php';
require 'tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => $this->consumerkey,
'consumer_secret' => $this->consumersecret,
'user_token' => $this->accesstoken,
'user_secret' => $this->accesstokensecret,
'curl_ssl_verifypeer' => false
));
$args = array('id' => '23424975');
$code = $tmhOAuth->request("GET", $tmhOAuth->url("https://api.twitter.com/1.1/trends/place.json"), $args);
print $code;
$res = $tmhOAuth->response['response'];
$trends = json_decode($res, true);
return $trends;
}
答案 0 :(得分:3)
尝试从网址中删除https://api.twitter.com/
。我也得到了404,直到我删除了该段的URL,现在我得到了200响应代码。