Skip to content

Instantly share code, notes, and snippets.

@johanbove
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save johanbove/b6e1b21c9d6a3b09da56 to your computer and use it in GitHub Desktop.

Select an option

Save johanbove/b6e1b21c9d6a3b09da56 to your computer and use it in GitHub Desktop.
$.get("https://api.github.com/repos/johanbove/johanbove.github.io/commits", function (data) {
var date,
datepart,
msg,
$out,
i,
limit = 10;
for (i = 0; i < limit; i += 1) {
$out = $("<li/>");
//console.info(data[i]);
//console.info("url", data[i]["html_url"]);
msg = data[i].commit.message;
date = data[i].commit.committer.date;
datepart = date.split("T")[0];
$out.append(
$("<span/>", {
"class": "date"
}).text(datepart),
$("<a/>", {
"class": "message",
"href": data[i]["html_url"]
}).text(msg));
$('.changelog').append($out);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment