/ Published in: PHP
                    
                                        
PHP function of mini bot class that lets you retrieve twitter infos from twitter nickname.
($this->attr method is part of the Mini Bot Class)
                ($this->attr method is part of the Mini Bot Class)
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
/* this function is part of the Mini Bot Class */
//
// get twitter infos from nickname
// and get avatar url
public function twitterInfo($nick) {
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
if ($this->attr($spans[0][$i],"id")=="following_count") $o['following'] = $spans[1][$i];
if ($this->attr($spans[0][$i],"id")=="follower_count") $o['follower'] = $spans[1][$i];
if ($this->attr($spans[0][$i],"id")=="lists_count") $o['lists'] = $spans[1][$i];
}
$o['avatar'] = "";
for ($i=0;$i<count($t[0]);$i++) if (attr($t[0][$i],"id")=="profile-image") $o['avatar'] = attr($t[0][$i],"src");
return $o;
}
URL: http://www.barattalo.it/2010/03/01/php-to-get-twitter-infos-and-avatar/
Comments
 Subscribe to comments
                    Subscribe to comments
                
                