The Unofficial GitHub-Buttons
for MooTools / jQuery / PHP

Show your Love to GitHub with the power of MooTools, jQuery or PHP
including buttons for stargazers, watchers, forks and followers


Providing a platform coherent API



PHP

Requires: PHP 5.3

// create new instance of GitHubButtons using current directory as cache
$ghb = new GitHubButtons(__DIR__);

// create a new stargazer button
echo $ghb->button(array(
	'owner' => 'AndiDittrich',
	'repo' => 'EnlighterJS',
	'large' => true,
	'type' => 'star',
	'text' => 'Starring:',
	'cache' => true,
	'cacheLifetime' => 7200,
	'errorText' => 'NA'
));

PHP-Singleton

Requires: PHP 5.3

// initialize GitHubButtons singleton using current directory as cache
GitHubButtons::getInstance(__DIR__);

// create a new stargazer button
GitHubButtons::getInstance()->button(array(
	'owner' => 'AndiDittrich',
	'repo' => 'EnlighterJS',
	'large' => true,
	'type' => 'star',
	'text' => 'Starring:',
	'cache' => true,
	'cacheLifetime' => 7200,
	'errorText' => 'NA'
));

Sources: Native MooTools Code - Native jQuery Code - Native PHP Code - Stylesheet

All required files are located into the Dist/ directory including compressed versions!


Download on GitHub