Bonjour, j'utilise l'api twitter afin de récupérer les hastags. je récupère les infos, cependant elles sont en fouillis, pas rangé dans des tableaux. Comment faire?
Voici mon code :
voici comment je reçois les données, bien entendu je ne vais pas tout mettre ^^ :stdClass Object ( [completed_in] => 0.246 [max_id] => 2.7895308053447E+17 [max_id_str] => 278953080534470656 [next_page] => ?page=2&max_id=278953080534470656&q=%23coca&rpp=100&result_type=recent
=> 1
=> %23coca [refresh_url] => ?since_id=278953080534470656&q=%23coca&result_type=recent
=> Array ( [0] => stdClass Object ( [created_at] => Wed, 12 Dec 2012 20:02:52 +0000 [from_user] => SigneBennike [from_user_id] => 995382043 [from_user_id_str] => 995382043 [from_user_name] => Signe Bennike
=> stdClass Object (
=> Array ( [0] => 45.447002 [1] => 6.986087 )
=> Point )
=> 2.7895308053447E+17 [id_str] => 278953080534470656 [iso_language_code] => en
=> stdClass Object ( [result_type] => recent ) [profile_image_url] => http://a0.twimg.com/profile_images/2944163888/54e76faa2d8632858714e46db26ba3fe_normal.jpeg [profile_image_url_https] => https://si0.twimg.com/profile_images/2944163888/54e76faa2d8632858714e46db26ba3fe_normal.jpeg
=> <a href="http://twitter.com/download/iphone">Twitter for iPhone</a>
=> First day skiing in @valdisere ! now we are ready for the first guests tomorrow a #coca-cola-ski-chalet @NortlanderDK http://t.co/XeFlha7b [to_user] => [to_user_id] => 0 [to_user_id_str] => 0 [to_user_name] => ) [1] => stdClass Object ( [created_at] => Wed, 12 Dec 2012 20:00:42 +0000 [from_user] => Imsorella [from_user_id] => 833747006 [from_user_id_str] => 833747006 [from_user_name] => Sora Minaj
=>
=> 2.7895253839134E+17 [id_str] => 278952538391339009 [iso_language_code] => pt
=> stdClass Object ( [result_type] => recent ) [profile_image_url] => http://a0.twimg.com/profile_images/2902668129/75f5b9f05958a0feac7f4324319caded_normal.jpeg [profile_image_url_https] => https://si0.twimg.com/profile_images/2902668129/75f5b9f05958a0feac7f4324319caded_normal.jpeg
=> <a href="http://www.apple.com">iOS</a>
=> TEAM #COCA [to_user] => [to_user_id] => 0 [to_user_id_str] => 0 [to_user_name] => ) [2] => stdClass Object ( [created_at] => Wed, 12 Dec 2012 19:57:30 +0000 [from_user] => DavidChaf [from_user_id] => 952413559 [from_user_id_str] => 952413559 [from_user_name] => Davide Savarese
=>
=> 2.7895173285428E+17 [id_str] => 278951732854280192 [iso_language_code] => pt
=> stdClass Object ( [result_type] => recent ) [profile_image_url] => http://a0.twimg.com/profile_images/2918498844/d659971cdb249fb2c683df34db8d4999_normal.jpeg [profile_image_url_https] => https://si0.twimg.com/profile_images/2918498844/d659971cdb249fb2c683df34db8d4999_normal.jpeg
=> <a href="https://mobile.twitter.com">Mobile Web (M2)</a>
=> #Pizza #Coca e tante risate!
[to_user] => [to_user_id] => 0 [to_user_id_str] => 0 [to_user_name] => ) [3] => stdClass Object ( [created_at] => Wed, 12 Dec 2012 19:55:28 +0000 [from_user] => DeeyGlz [from_user_id] => 152415198 [from_user_id_str] => 152415198 [from_user_name] => Deey Glz
=>
=> 2.7895121962664E+17 [id_str] => 278951219626643456 [iso_language_code] => es
=> stdClass Object ( [result_type] => recent ) [profile_image_url] => http://a0.twimg.com/profile_images/2963493071/a0ae566d32d03da47302d13c0c63ef3b_normal.jpeg [profile_image_url_https] => https://si0.twimg.com/profile_images/2963493071/a0ae566d32d03da47302d13c0c63ef3b_normal.jpeg
=> <a href="http://twitter.com/">web</a>
=> Hoy será una noche de #Coca-Cola #Chocolate #UnPocoDeCafe #DulcesPico
Merci à vous
Voici mon code :
<?php
$keyword = "#coca";
// On doit percent-encoder la recherche
// Ici, le "#" sera remplacé par "%23"
$prct_keyword = urlencode($keyword);
// Chaine d'appel à l'API
$search_string = "http://search.twitter.com/search.json?q=".$prct_keyword."&rpp=100&include_entities=false&result_type=recent";
$json = file_get_contents($search_string);
$array = json_decode($json);
print_r($array);
?>
voici comment je reçois les données, bien entendu je ne vais pas tout mettre ^^ :stdClass Object ( [completed_in] => 0.246 [max_id] => 2.7895308053447E+17 [max_id_str] => 278953080534470656 [next_page] => ?page=2&max_id=278953080534470656&q=%23coca&rpp=100&result_type=recent


























Merci à vous