0
Array
(
    [statuses] => Array
        (
            [0] => Array
                (
                    [metadata] => Array
                        (
                            [result_type] => recent
                            [iso_language_code] => en
                        )

                    [created_at] => Wed Jul 30 17:15:35 +0000 2013
                    [id] => 3626225823751905
                    [id_str] => 3626225875190528
                    [text] =>Where are you?

                     [user] => Array
                        (
                            [id] => 192994
                            [id_str] => 192994
                            [name] => Stupido
                            [screen_name] => Stupido
                            [location] => 
                            [description] =>I'm who I'm
                            [url] => http://t.co/xehevCed
                            [entities] => Array
                                (
                                    [url] => Array
                                        (
                                            [urls] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [url] => http://t.co/xehevCed

SO、最近の 20 個のツイートがあります - JSON_decode() : しかし、実際にテキストと URL を取得するにはどうすればよいでしょうか? ネストされた配列。

誰かが助けることができますか?

4

1 に答える 1

0

Abraham Twitteroauth を使用していますか?

これを試して:

$parameters = array('screen_name' => 'twitter' /* your screen name */, 'result_type' => 'recent', 'count' => '20' /* your limit */  );

$content = $connection->get("statuses/user_timeline", $parameters);

for($i = 0; $i < 20 /* your limit */; ++$i) {

echo $content[$i]->text . $content[$i]->user->url . "<hr />";

}
于 2013-07-31T20:49:32.463 に答える