How to get no of followers on twitter using PHP

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

phpkiller
New php-forum User
New php-forum User
Posts: 31
Joined: Thu Jun 28, 2012 2:11 pm

How to get no of followers on twitter using PHP

Postby phpkiller » Tue Mar 05, 2013 1:48 am

Try this code:


<?php $url = "https://twitter.com/users/show/<your_twitter_name>";

$response = file_get_contents($url, true);

$t_profile = new SimpleXMLElement($response);

$count = $t_profile->followers_count;

echo $count." Followers";

?>

Just make sure that in your php extensions->php_openssl is active. If not than change its state to active and restart all services of your apache.

Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 1 guest