0
好存储在SQL数据库鸣叫,无法早上
我想用PHP编写一小段脚本,它连接到Twitter API,下载鸣叫,并将它们存储到SQL数据库中。 我使用的是1.1版本的Twitter API与TwitterOAuth对象的亚伯拉罕
$connection = new TwitterOAuth($consumer_key,$consumer_secret,$access_token,$access_token_secret);
$tweet = $connection->get(
'search/tweets',
array("q" => "rome", "lang" => "it")
);
$jsonData = json_decode($tweet);
使用此代码,脚本成功地连接到Twitter的API,但json_decode创建的$ jsonData是空的。我想知道为什么会发生这种情况,如果$ tweet是json格式。
在'$ jsonData = ..'行之前放了'var_dump($ tweet);''。 – Himal