-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
84 lines (72 loc) · 2.26 KB
/
index.html
File metadata and controls
84 lines (72 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Code Resume</title>
<!--<link type="text/css" href="styles.css" media="screen" rel="Stylesheet" />-->
<script type="text/javascript" src="jquery-2.1.1.min.js"></script>
</head>
<body>
<div id="header">
<h1>Code Resume</h1>
</div>
<div id="navigation">
<ul>
<li><a href="#home" id="home_link" class="selected">Home</a></li>
</ul>
</div>
<div class="content" id="home">
<div>
<p>
A pure JS client side website for showing your code
resume. Like Ohloh, but not terrible. And free open
source software.
</p>
</div>
</div>
<div class="content" id="github">
Github Repos
<div id="github_repos">
</div>
</div>
<div id="footer">This website is available under the MIT license at
<a href="https://github.com/workhorsy/code_resume" target="_blank">https://github.com/workhorsy/code_resume</a>
<br />
Copyright © 2014 <a href="http://workhorsy.org" target="_blank">Matthew Brennan Jones</a>
</div>
<script type="text/javascript" language="JavaScript">
$(function() {
// Github API V3
// https://developer.github.com/v3/
var BASE_URL = "https://api.github.com/";
var user_name = "workhorsy";
var user_emails = [
"matthew.brennan.jones@gmail.com",
"mattjones@workhorsy.org"
];
var url = BASE_URL + "users/" + user_name + "/repos";
// Each repository
$.getJSON(url, function(data) {
$.each(data, function(n, repo) {
var url = BASE_URL + "repos/" + user_name + "/" + repo["name"] + "/stats/contributors";
// Each contributor
$.getJSON(url, function(data) {
var my_commits = 0;
var all_commits = 0;
$.each(data, function(n, contributors) {
var author = contributors["author"]["login"];
var commits = contributors["total"];
if(author == user_name) {
my_commits = commits;
}
all_commits += commits;
});
var message = repo["name"] + " commits: " + my_commits + " of " + all_commits + "<br />";
$("#github_repos").append(message);
});
});
});
});
</script>
</body>
</html>