Hola a todos, lo que pasa es lo siguiente mediante el metodo [URL="http://api.twitter.com/1/statuses/user_timeline.json?screen_name=$screen_name&count= 200"]http://api.twitter.com/1/statuses/user_timeline.json?screen_name=and_sossa&count=200[/URL] de la api de twitter obtengo la cantidad de retweets,
asi.
Código:
$conexion = curl_init();
curl_setopt($conexion, CURLOPT_URL, "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=and_sossa&count=200");
// curl_setopt($conexion, CURLOPT_URL, "http://api.twitter.com/1/users/show.json?screen_name=$screen_name");
curl_setopt($conexion, CURLOPT_RETURNTRANSFER, true);
$usuario = json_decode(curl_exec($conexion));
curl_close($conexion);
$totalTweets = count($usuario);
for ($i=0;$i<$totalTweets;$i++)
{
$retweet=$retweet+$usuario[$i]->retweet_count;
}
ahora para no hacer doble llamado a la api quiero tomar estos datos.
Código:
[user] => stdClass Object
(
[following] =>
[friends_count] => 160
[show_all_inline_media] =>
[geo_enabled] =>
[profile_link_color] => b30000
[profile_image_url] => http://a0.twimg.com/profile_images/1143268145/ustream_normal.jpg
[description] => Presidente de la República de Colombia 2002-2010
http://www.alvarouribevelez.com
[profile_sidebar_border_color] => edf0f5
[url] => [listed_count] => 4822
[followers_count] => 317851
[screen_name] => AlvaroUribeVel
[statuses_count] => 3910
[profile_use_background_image] => 1
[location] => Colombia
[profile_background_color] => e1e1e1
[lang] => es
[notifications] =>
[profile_background_image_url] => http://a1.twimg.com/profile_background_images/189931296/twitterbg2.jpg
[favourites_count] => 10
[created_at] => Wed Jul 29 03:08:18 +0000 2009
[protected] =>
[verified] => 1
[time_zone] => Bogota
[profile_text_color] => 333333
[name] => Ãlvaro Uribe Vélez
[is_translator] =>
[contributors_enabled] =>
[profile_sidebar_fill_color] => bdbdbd
[id] => 61097151
[id_str] => 61097151
[follow_request_sent] =>
[profile_background_tile] =>
[utc_offset] => -18000
)
[in_reply_to_status_id] =>
[id] => 45157796227989504
[id_str] => 45157796227989504
)
pero
Código:
$nombre=$usuario[0]->user;
No me devuelve nada, y quiero capturar esos datos, si alguien me podria guiar se lo agradeceria.