2011-07-15 5 views
0

Comment puis-je obtenir seulement le texte de twitter statuses/user_timeline et le faire correspondre avec php regex qui renvoient true ou false?Twitter obtenir le dernier tweet avec l'API twitter en PHP

par exemple je reçois ce

Array (
    [0] => stdClass Object 
     (
      [place] => 
      [truncated] => 
      [user] => stdClass Object 
       (
        [default_profile_image] => 
        [statuses_count] => 1944 
        [profile_background_tile] => 1 
        [protected] => 
        [contributors_enabled] => 
        [url] => http://www.mediawebsiteplus.com 
        [name] => Media Website Plus 
        [id_str] => 185200584 
        [is_translator] => 
        [profile_link_color] => D02B55 
        [follow_request_sent] => 
        [utc_offset] => 
        [created_at] => Tue Aug 31 13:04:35 +0000 2010 
        [friends_count] => 1699 
        [profile_sidebar_border_color] => 829D5E 
        [following] => 1 
        [time_zone] => 
        [profile_image_url] => http://a3.twimg.com/profile_images/1426659184/mwp_logo_normal.png 
        [description] => Media Website Plus adalah jasa pembuatan web, jasa pembuatan website, blog, web sekolah, toko online, dan aneka software murah dan berkualitas tinggi. 
        [profile_use_background_image] => 1 
        [favourites_count] => 0 
        [verified] => 
        [profile_background_color] => 352726 
        [screen_name] => jasabuatwebsite 
        [listed_count] => 0 
        [profile_background_image_url] => http://a3.twimg.com/profile_background_images/283557264/mwp_logo.png 
        [id] => 185200584 
        [show_all_inline_media] => 
        [geo_enabled] => 
        [default_profile] => 
        [notifications] => 
        [profile_background_image_url_https] => https://si0.twimg.com/profile_background_images/283557264/mwp_logo.png 
        [profile_text_color] => 3E4415 
        [lang] => en 
        [profile_sidebar_fill_color] => 99CC33 
        [followers_count] => 210 
        [profile_image_url_https] => https://si0.twimg.com/profile_images/1426659184/mwp_logo_normal.png 
        [location] => indonesia 
       ) 

      [id_str] => 91808775270432768 
      [in_reply_to_status_id] => 
      [text] => Govt Will Not Increase Subsidized Fuel Prices: “In the remaining time of the year there may be an option to rais... http://bit.ly/qJqn9H 
      [created_at] => Fri Jul 15 09:58:12 +0000 2011 
      [geo] => 
      [favorited] => 
      [in_reply_to_status_id_str] => 
      [coordinates] => 
      [id] => 9.18087752704E+16 
      [in_reply_to_screen_name] => 
      [source] => <a href="http://twitterfeed.com" rel="nofollow">twitterfeed</a> 
      [in_reply_to_user_id_str] => 
      [in_reply_to_user_id] => 
      [contributors] => 
      [retweeted] => 
      [retweet_count] => 0 
     ) 

)

+0

Si vous avez résolu votre question, s'il vous plaît poster votre solution comme une réponse et l'accepter plutôt que de l'éditer dans votre question. Merci! –

Répondre

0

Je l'ai résolu:

$sep_status = $home_timeline[0]->text; 
if (eregi($status, $sep_status)){ 
    echo "true !"; 
} else { 
    echo "false !"; 
} 
Questions connexes