CARVIEW |
We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]
Every repository with this icon (

Every repository with this icon (

Description: | This is a banner which can display the latest commit of a Github-repo on your website. |
Homepage: | https://github.com/heipei/github-commit-badge/tree/master |
Clone URL: |
git://github.com/heipei/github-commit-badge.git
Give this clone URL to anyone.
git clone git://github.com/heipei/github-commit-badge.git
|
name | age | message | |
---|---|---|---|
![]() |
BUGS | Wed Aug 20 07:09:08 -0700 2008 | Code cleanup, a few comments here and there [heipei] |
![]() |
LICENSE | Sun Aug 17 15:24:03 -0700 2008 | Version soon to be put up on Github [heipei] |
![]() |
README.markdown | Mon Aug 18 10:50:47 -0700 2008 | Branch master is now default, branch argument o... [heipei] |
![]() |
TODO | Sat Aug 23 06:57:23 -0700 2008 | Commented new code, gzipped lib-loading only wh... [heipei] |
![]() |
github-commit-badge.js | Sat Aug 23 12:33:02 -0700 2008 | Use jQuery for easy readability [heipei] |
![]() |
img/ | Sun Aug 17 15:24:03 -0700 2008 | Version soon to be put up on Github [heipei] |
![]() |
index.html | Mon Aug 18 10:50:47 -0700 2008 | Branch master is now default, branch argument o... [heipei] |
![]() |
lib/ | Sat Aug 23 04:05:39 -0700 2008 | gzipped the everything.js [heipei] |
![]() |
style.css | Sat Aug 23 06:35:25 -0700 2008 | Show/Hide-Files implemented [heipei] |
Github Commit Badge
This badge/banner can be used for displaying the latest (or a specific commit) for a github-project on your website.

It is implemented in JavaScript, therefore it is completely client-based. Since this is the first time I’ve actually used JavaScript, the first time I actually wrote a CSS from scratch expect things to be buggy.
That said I’d be happy about ideas/patches. Look at the BUGS file or the TODO or come up with something own.
Usage
To use it on your website you’ll have to put this somewhere. This means the .js file as well as the .css and the lib/ and img/ directories. To adjust the width of the whole thing look inside the style.css and set it for the container-class. I know that the way to define user/repos is still somewhat cumbersome. The “branch” entry is optional, default is “master”.
<div id="github-commit-badge-container">
<script type="text/javascript">
var Badges = new Array();
Badges[0] = new Object;
Badges[0]["username"] = "heipei";
Badges[0]["repo"] = "github-test";
Badges[1] = new Object;
Badges[1]["username"] = "heipei";
Badges[1]["repo"] = "xmpp4r";
Badges[1]["branch"] = "master";
</script>
<script type="text/javascript" src="github-commit-badge.js"></script>
</div>
If you want to use it on something like WordPress you’ll have to put HTML quotes around the content of the first script-block
Website
https://github.com/heipei/github-commit-badge/tree for now. See a working demonstration at https://hackvalue.de/~heipei/tmp/github-commit-badge/
FAQ
Q: Why is it called a badge when it’s really more of a banner? A: Because I noticed that calling it banner increases the risk of it being filtered by AdBlock etc.
Q: Why does the JavaScript look like shit and is inconsistent? A: Because I don’t know a thing about JavaScript and the million things that can and do fail. That’s why there might be some workarounds ;)
Q: What libs are used (and what for)? A: jQuery for jQuery.getJSON and jQuery.each, datejs for Date.parse and md5 for md5hex (for the gravatar). Also I learned a lot from DrNic’s GitHub-badges https://github.com/drnic/github-badges/tree.
Author
Johannes ‘heipei’ Gilger heipei@hackvalue.de