PHP GitHub followers count script (v3.0 API)

Php GitHub Followers Count

The following PHP GitHub Followers Count script is using the v3.0 GitHub API.



 I’ll explain how to get your github  followers count using PHP.


Get Followers Count

function curl_get_contents($url)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080311 Firefox/');
$data = curl_exec($ch);
return $data;
$github_data = json_decode(curl_get_contents(''), true);
$github_followers_count = $github_data['followers'];
echo $github_followers_count;



More information

This article was based on the work of Jimbo and Meenakshi Sundaram R

Development Specialist, Artist and Activist
Personal Website

Leave a Reply

Your email address will not be published.