Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82b0e1e

Browse files
committed
new deployment
1 parent53caf1d commit82b0e1e

File tree

7 files changed

+233
-28
lines changed

7 files changed

+233
-28
lines changed

‎404/index.html‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>Page not found</title>
88
<linkrel="shortcut icon"href="/img/coderstats.png">
99
<linkrel="canonical"href="http://localhost:8080/404/"/>
10-
<linkrel="stylesheet"href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
10+
<linkrel="stylesheet"href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
1111
<linkrel="stylesheet"href="/compiled/style.css">
1212
</head>
1313
<body>
@@ -22,9 +22,9 @@ <h1>Page not found</h1>
2222
<ahref="https://chrome.google.com/webstore/detail/necogepejonacpphmlmcagmbjaogpbng">Chrome Extension</a><ahref="https://addons.mozilla.org/en-US/firefox/addon/coderstats/">Firefox Add-on</a><ahref="https://teespring.com/stores/codershirts"title="T-Shirts, hoodies, mugs and stickers for coders">CoderShirts Store</a>
2323
</footer>
2424

25-
<scriptsrc="//cdn.jsdelivr.net/npm/vue"></script>
26-
<scriptsrc="//cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
27-
<scriptsrc="//cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
28-
<scriptsrc="//cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
25+
<scriptsrc="https://cdn.jsdelivr.net/npm/vue"></script>
26+
<scriptsrc="https://cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
27+
<scriptsrc="https://cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
28+
<scriptsrc="https://cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
2929
</body>
3030
</html>

‎compiled/coder.js‎

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,143 @@
1-
constDEV=0;letbar_options={axisX:{onlyInteger:!0},axisY:{offset:100,showGrid:!1},horizontalBars:!0,reverseData:!0},github_user=null;document.location.hash?github_user=document.location.hash.replace('#',''):document.location.href='/',document.title=`CoderStats(${github_user})`,document.getElementsByClassName('brand')[0].textContent=document.title;leturl_user=`https://api.github.com/users/${github_user}`,url_repos=`${url_user}/repos?sort=pushed&per_page=100`,months_short=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];letcoder=newVue({el:'#coder',data:{repos:[],response:{},sort_orders:{},sort_key:'',user:null},computed:{repos_pushed:function(){returnthis.repos.filter((a)=>a.pushed_at>a.created_at)},repos_pushed_ratio:function(){returnthis.repos.length?this.repos_pushed.length/this.repos.length:0},languages:function(){returnd3.nest().key((a)=>a.language).rollup((a)=>a.length).entries(this.repos_pushed.filter((a)=>a.language)).sort((c,a)=>a.value-c.value)},issues:function(){returnthis.repoRanking('open_issues_count')},forks:function(){returnthis.repoRanking('forks_count')},stars:function(){returnthis.repoRanking('stargazers_count')},total_forks:function(){returnd3.sum(this.forks,(a)=>a.forks_count)},total_issues:function(){returnd3.sum(this.issues,(a)=>a.open_issues_count)},total_stars:function(){returnd3.sum(this.stars,(a)=>a.stargazers_count)}},filters:{fixURL:(a)=>(a.startsWith('http')||(a=`http://${a}`),a),formatDate:(a)=>{letb=newDate(a);return`${b.getDate()}${months_short[b.getMonth()]}${b.getYear()+1900}`},formatURL:(a)=>a.split('://').pop().replace(/\/$/,'')},created:function(){this.fetchRepos(),this.fetchUser()},updated:function(){leta=this.languages.slice(0,10);newChartist.Bar('#language-ranking',{labels:a.map((a)=>a.key),series:[a.map((a)=>a.value)]},bar_options),this.rankingGraph(this.issues.slice(0,10),'open_issues_count','#issues-ranking'),this.rankingGraph(this.forks.slice(0,10),'forks_count','#forks-ranking'),this.rankingGraph(this.stars.slice(0,10),'stargazers_count','#stars-ranking')},methods:{fetchRepos:function(){this.$http.get(url_repos).then((a)=>{this.response.repos=a,this.repos=a.body})},fetchUser:function(){this.$http.get(url_user).then((a)=>{this.response.user=a,this.user=a.body,this.user.name||(this.user.name=this.user.login)})},order:function(a){return0>this.sort_orders[a]?'dsc':'asc'},rankingGraph:function(a,b,c){a.length&&newChartist.Bar(c,{labels:a.map((a)=>a.name),series:[a.map((a)=>a[b])]},bar_options)},repoRanking:function(c){returnthis.repos_pushed.filter((a)=>a[c]).sort((d,a)=>a[c]-d[c])},sortBy:function(c,d='number'){lete='string'===d?'':0;this.sort_key=c,this.sort_orders[c]=-1*(this.sort_orders[c]||1),this.repos.sort((f,a)=>{letb=f[c]||e,g=a[c]||e;return'string'===d&&(b=b.toLowerCase(),g=g.toLowerCase()),(b===g?0:b>g?1:-1)*this.sort_orders[c]})}}});
1+
constDEV=0;
2+
3+
letbar_options={
4+
axisX:{onlyInteger:true},
5+
axisY:{offset:100,showGrid:false},
6+
horizontalBars:true,
7+
reverseData:true
8+
};
9+
10+
letgithub_user=null;
11+
if(document.location.hash){
12+
github_user=document.location.hash.replace('#','');
13+
}else{
14+
document.location.href='/';
15+
}
16+
// Set these values here because they are outside of vue's scope.
17+
letshort_title=`CoderStats(${github_user})`;
18+
document.title=document.title.replace('CoderStats',short_title);
19+
document.getElementsByClassName('brand')[0].textContent=short_title;
20+
21+
leturl_user=`https://api.github.com/users/${github_user}`,
22+
url_repos=`${url_user}/repos?sort=pushed&per_page=100`,
23+
months_short='Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
24+
25+
if(DEV){
26+
url_user='/data/user.json';
27+
url_repos='/data/repos.json';
28+
}
29+
30+
letcoder=newVue({
31+
el:'#coder',
32+
data:{
33+
repos:[],
34+
response:{},
35+
sort_orders:{},
36+
sort_key:'',
37+
user:null
38+
},
39+
computed:{
40+
// Only repos the user actually pushed at, i.e. no forks with no user commits.
41+
repos_pushed:function(){
42+
returnthis.repos.filter(d=>d.pushed_at>d.created_at);
43+
},
44+
repos_pushed_ratio:function(){
45+
returnthis.repos.length ?this.repos_pushed.length/this.repos.length :0;
46+
},
47+
languages:function(){
48+
returnd3.nest().key(d=>d.language).rollup(leaves=>leaves.length).entries(this.repos_pushed.filter(d=>d.language)).sort((a,b)=>b.value-a.value);
49+
},
50+
issues:function(){
51+
returnthis.repoRanking('open_issues_count');
52+
},
53+
forks:function(){
54+
returnthis.repoRanking('forks_count');
55+
},
56+
stars:function(){
57+
returnthis.repoRanking('stargazers_count');
58+
},
59+
total_forks:function(){
60+
returnd3.sum(this.forks,d=>d.forks_count);
61+
},
62+
total_issues:function(){
63+
returnd3.sum(this.issues,d=>d.open_issues_count);
64+
},
65+
total_stars:function(){
66+
returnd3.sum(this.stars,d=>d.stargazers_count);
67+
}
68+
},
69+
filters:{
70+
fixURL:value=>{
71+
if(!value.startsWith('http')){
72+
value=`http://${value}`;
73+
}
74+
returnvalue;
75+
},
76+
formatDate:value=>{
77+
letdt=newDate(value);
78+
return`${dt.getDate()}${months_short[dt.getMonth()]}${dt.getYear()+1900}`;
79+
},
80+
formatURL:value=>{
81+
returnvalue.split('://').pop().replace(/\/$/,'');
82+
}
83+
},
84+
created:function(){
85+
this.fetchRepos();
86+
this.fetchUser();
87+
},
88+
updated:function(){
89+
letlanguage_ranking=this.languages.slice(0,10);
90+
newChartist.Bar('#language-ranking',{
91+
labels:language_ranking.map(d=>d.key),
92+
series:[language_ranking.map(d=>d.value)]
93+
},bar_options);
94+
95+
this.rankingGraph(this.issues.slice(0,10),'open_issues_count','#issues-ranking');
96+
this.rankingGraph(this.forks.slice(0,10),'forks_count','#forks-ranking');
97+
this.rankingGraph(this.stars.slice(0,10),'stargazers_count','#stars-ranking');
98+
},
99+
methods:{
100+
fetchRepos:function(){
101+
this.$http.get(url_repos).then(response=>{
102+
this.response.repos=response;
103+
this.repos=response.body;
104+
});
105+
},
106+
fetchUser:function(){
107+
this.$http.get(url_user).then(response=>{
108+
this.response.user=response;
109+
this.user=response.body;
110+
if(!this.user.name)this.user.name=this.user.login;
111+
});
112+
},
113+
order:function(key){
114+
// asc is default, because sort orders are initially unset
115+
returnthis.sort_orders[key]<0 ?'dsc' :'asc';
116+
},
117+
rankingGraph:function(series,property,selector){
118+
if(series.length){
119+
newChartist.Bar(selector,{
120+
labels:series.map(d=>d.name),
121+
series:[series.map(d=>d[property])]
122+
},bar_options);
123+
}
124+
},
125+
repoRanking:function(property){
126+
returnthis.repos_pushed.filter(d=>d[property]).sort((a,b)=>b[property]-a[property]);
127+
},
128+
sortBy:function(key,type='number'){
129+
letdefault_value=type==='string' ?'' :0;
130+
this.sort_key=key;
131+
this.sort_orders[key]=(this.sort_orders[key]||1)*-1;
132+
this.repos.sort((a,b)=>{
133+
letx=a[key]||default_value,
134+
y=b[key]||default_value;
135+
if(type==='string'){
136+
x=x.toLowerCase();
137+
y=y.toLowerCase();
138+
}
139+
return(x===y ?0 :x>y ?1 :-1)*this.sort_orders[key];
140+
});
141+
}
142+
}
143+
});

‎compiled/front.js‎

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,59 @@
1-
Vue.component('user-link',{props:['login','avatar_url'],template:`
1+
Vue.component('user-link',{
2+
props:['login','avatar_url'],
3+
template:`
24
<div class="col-1-xl col-2-l col-4-m col-12">
35
<a v-bind:href="'/github#' + login">
46
<img :src="avatar_url" :alt="login"/><br>
57
<i class="fa fa-user" aria-hidden="true"></i> {{ login }}
68
</a>
79
</div>
8-
`}),newVue({el:'#active-users',data:{events:null},computed:{users:function(){returnd3.nest().key((a)=>a.actor.login).entries(this.events.filter((a)=>'PushEvent'===a.type)).sort((c,a)=>a.values.length-c.values.length)}},created:function(){this.$http.get('https://api.github.com/events').then((a)=>{this.events=a.body})}}),newVue({el:'#followed-users',data:{users:[]},created:function(){this.$http.get('/data/users.json').then((a)=>{this.users=a.body.items})}}),newVue({el:'#most-repos-users',data:{users:[]},created:function(){this.$http.get('/data/most-repos-users.json').then((a)=>{this.users=a.body.items})}}),newVue({el:'#earliest-users',data:{users:[]},created:function(){this.$http.get('/data/earliest-users.json').then((a)=>{this.users=a.body.items})}});
10+
`
11+
});
12+
13+
newVue({
14+
el:'#active-users',
15+
data:{events:null},
16+
computed:{
17+
users:function(){
18+
returnd3.nest().key(d=>d.actor.login).entries(this.events.filter(d=>d.type==='PushEvent')).sort((a,b)=>b.values.length-a.values.length);
19+
}
20+
},
21+
created:function(){
22+
this.$http.get('https://api.github.com/events').then(response=>{
23+
this.events=response.body;
24+
});
25+
}
26+
});
27+
28+
newVue({
29+
el:'#followed-users',
30+
data:{users:[]},
31+
created:function(){
32+
// https://api.github.com/search/users?q=repos:%3E1&sort=followers&order=desc
33+
this.$http.get('/data/users.json').then(response=>{
34+
this.users=response.body.items;
35+
});
36+
}
37+
});
38+
39+
newVue({
40+
el:'#most-repos-users',
41+
data:{users:[]},
42+
created:function(){
43+
// https://api.github.com/search/users?q=repos:%3E1%20type:user&sort=repositories&order=desc
44+
this.$http.get('/data/most-repos-users.json').then(response=>{
45+
this.users=response.body.items;
46+
});
47+
}
48+
});
49+
50+
newVue({
51+
el:'#earliest-users',
52+
data:{users:[]},
53+
created:function(){
54+
// https://api.github.com/search/users?q=repos:%3E1%20type:user&sort=joined&order=asc
55+
this.$http.get('/data/earliest-users.json').then(response=>{
56+
this.users=response.body.items;
57+
});
58+
}
59+
});

‎compiled/search.js‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
letsearch=newVue({el:'#search',data:{username:''},methods:{coder:function(){this.username&&(document.location.href=`/github#${this.username}`)}}});
1+
letsearch=newVue({
2+
el:'#search',
3+
data:{
4+
username:''
5+
},
6+
methods:{
7+
coder:function(){
8+
if(this.username){
9+
document.location.href=`/github#${this.username}`;
10+
}
11+
}
12+
}
13+
});

‎github/index.html‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<head>
44
<metacharset="utf-8">
55
<metaname="viewport"content="width=device-width, initial-scale=1.0">
6-
<metaname="description"content="">
7-
<title>CoderStats</title>
6+
<metaname="description"content="Summary statistics, rankings and repositories about public source code repositories on GitHub.">
7+
<title>CoderStats - Summary Statistics, Rankings and Repositories</title>
88
<linkrel="shortcut icon"href="/img/coderstats.png">
99
<linkrel="canonical"href="http://localhost:8080/github/"/>
10-
<linkrel="stylesheet"href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
10+
<linkrel="stylesheet"href="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
1111
<linkrel="stylesheet"href="/compiled/coder.css">
12-
<linkrel="stylesheet"href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
12+
<linkrel="stylesheet"href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
1313
<linkrel="stylesheet"href="/compiled/style.css">
1414
</head>
1515
<body>
1616
<navclass="container-full clear"><divclass="row">
1717
<divclass="col-12 col-4-xl col-4-l col-5-m">
18-
<ahref="/"><imgsrc="/img/coderstats.png"></a>
18+
<ahref="/"><imgsrc="/img/coderstats.png"alt="logo"></a>
1919
<spanclass="brand">CoderStats()</span>
2020
</div>
2121
<divclass="col-12 col-8-xl col-8-l col-7-m"id="search">
@@ -160,12 +160,12 @@ <h2 id="repos">Repositories</h2>
160160
<ahref="https://chrome.google.com/webstore/detail/necogepejonacpphmlmcagmbjaogpbng">Chrome Extension</a><ahref="https://addons.mozilla.org/en-US/firefox/addon/coderstats/">Firefox Add-on</a><ahref="https://teespring.com/stores/codershirts"title="T-Shirts, hoodies, mugs and stickers for coders">CoderShirts Store</a>
161161
</footer>
162162

163-
<scriptsrc="//cdn.jsdelivr.net/npm/vue"></script>
164-
<scriptsrc="//cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
165-
<scriptsrc="//cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
166-
<scriptsrc="//cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
163+
<scriptsrc="https://cdn.jsdelivr.net/npm/vue"></script>
164+
<scriptsrc="https://cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
165+
<scriptsrc="https://cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
166+
<scriptsrc="https://cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
167167

168-
<scriptsrc="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
168+
<scriptsrc="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
169169
<scriptsrc="/compiled/coder.js"></script>
170170
<scriptsrc="/compiled/search.js"></script>
171171
</body>

‎index.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<head>
44
<metacharset="utf-8">
55
<metaname="viewport"content="width=device-width, initial-scale=1.0">
6-
<metaname="description"content="">
6+
<metaname="description"content="CoderStats is a free service that displays statistics about public source code repositories for GitHub users and organizations.">
77
<title>CoderStats - View Statistics for Millions of GitHub Users and Organizations</title>
88
<linkrel="shortcut icon"href="/img/coderstats.png">
99
<linkrel="canonical"href="http://localhost:8080/"/>
10-
<linkrel="stylesheet"href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
10+
<linkrel="stylesheet"href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
1111
<linkrel="stylesheet"href="/compiled/style.css">
1212
</head>
1313
<body>
@@ -74,10 +74,10 @@ <h2>Users with old accounts</h2>
7474
<ahref="https://chrome.google.com/webstore/detail/necogepejonacpphmlmcagmbjaogpbng">Chrome Extension</a><ahref="https://addons.mozilla.org/en-US/firefox/addon/coderstats/">Firefox Add-on</a><ahref="https://teespring.com/stores/codershirts"title="T-Shirts, hoodies, mugs and stickers for coders">CoderShirts Store</a>
7575
</footer>
7676

77-
<scriptsrc="//cdn.jsdelivr.net/npm/vue"></script>
78-
<scriptsrc="//cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
79-
<scriptsrc="//cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
80-
<scriptsrc="//cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
77+
<scriptsrc="https://cdn.jsdelivr.net/npm/vue"></script>
78+
<scriptsrc="https://cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
79+
<scriptsrc="https://cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
80+
<scriptsrc="https://cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
8181

8282
<scriptsrc="/compiled/front.js"></script>
8383
<scriptsrc="/compiled/search.js"></script>

‎rss.xml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<channel><title>RSS Feed</title>
44
<link>http://localhost:8080</link>
55
<description>RSS Feed</description>
6-
<lastBuildDate>Wed, 29 May 201901:23:37 </lastBuildDate>
6+
<lastBuildDate>Wed, 29 May 201911:17:18 </lastBuildDate>
77
<generator>Logya</generator>
88
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
99
<item>
10-
<title><![CDATA[CoderStats]]></title>
10+
<title><![CDATA[CoderStats - Summary Statistics, Rankings and Repositories]]></title>
1111
<link><![CDATA[http://localhost:8080/github/]]></link>
12-
<description><![CDATA[<p></p>]]></description>
12+
<description><![CDATA[<p>Summary statistics, rankings and repositories about public source code repositories on GitHub.</p>]]></description>
1313
<guid><![CDATA[http://localhost:8080/github/]]></guid>
1414
<pubDate>Fri, 22 Sep 2017 22:12:48 </pubDate>
1515
</item>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp