Show your Twitter Followers on WordPress

function string_getInsertedString($long_string,$short_string,$is_html=false){ if($short_string>=strlen($long_string))return false; $insertion_length=strlen($long_string)-strlen($short_string); for($i=0;$isaveHTML(); $element->parentNode->removeChild($element); $html2=$document->saveHTML(); return string_getInsertedString($html,$html2,true); } function getFollowers($username){ $x = file_get_contents(“http://twitter.com/”.$username); $doc = new DomDocument; @$doc->loadHTML($x); $ele = $doc->getElementById(‘follower_count’); $innerHTML=preg_replace(‘/^< [^>]*>(.*)< [^>]*>$/’,”\\1″,DOMElement_getOuterHTML($doc,$ele)); return $innerHTML; }

echo getFollowers(“cuisi”).” followers”;


Twitter Followers