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

Commit7911952

Browse files
committed
Merge branch 'master' of github.com:coderstats/coderstats.net
2 parents566484c +c83c7f5 commit7911952

25 files changed

+592
-235
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Logya
1+
#site
22
archive/
33
deploy/
44
public/

‎README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
#README
22

3-
Source files for[coderstats.net](https://coderstats.net/).
3+
Source files for[coderstats.net](https://coderstats.net/).
4+
5+
#GitHub API Calls
6+
7+
*https://api.github.com/users/yaph/events/public
8+
*https://api.github.com/users/yaph/received_events/public

‎content/github.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title:CoderStats
2+
title:CoderStats - Summary Statistics, Rankings and Repositories
3+
description:Summary statistics, rankings and repositories about public source code repositories on GitHub.
34
template:coder.html
45
created:2017-09-22T22:12:48
56
---

‎content/index.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
noindex:1
3+
created:2017-09-22T22:02:05
34
url:/
4-
title:CoderStats - View Statistics for Millions of GitHub Users
5+
title:CoderStats - View Statistics for Millions of GitHub Users and Organizations
6+
description:CoderStats is a free service that displays statistics about public source code repositories for GitHub users and organizations.
57
template:front.html
6-
created:2017-09-22T22:02:05
78
---

‎gulpfile.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ var gulp = require('gulp'),
44
cleanCSS=require('gulp-clean-css'),
55
concat=require('gulp-concat'),
66
spawn=require('child_process').spawn,
7-
sass=require('gulp-sass');
7+
sass=require('gulp-sass')
8+
tildeImporter=require('node-sass-tilde-importer');
89

910
vardo_minify=true;
1011

@@ -35,13 +36,13 @@ gulp.task('serve', function() {
3536
// Compile and copy scss styles
3637
gulp.task('scss',function(){
3738
gulp.src(paths.scss_coder)
38-
.pipe(sass().on('error',sass.logError))
39+
.pipe(sass({importer:tildeImporter}).on('error',sass.logError))
3940
.pipe(cleanCSS())
4041
.pipe(concat('coder.css'))
4142
.pipe(gulp.dest(paths.compiled));
4243

4344
returngulp.src(paths.scss_main)
44-
.pipe(sass().on('error',sass.logError))
45+
.pipe(sass({importer:tildeImporter}).on('error',sass.logError))
4546
.pipe(cleanCSS())
4647
.pipe(concat('style.css'))
4748
.pipe(gulp.dest(paths.compiled));

‎package.json‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"coderstats.net",
3-
"version":"0.0.1",
3+
"version":"1.0.0",
44
"description":"coderstats.net",
55
"keywords": [
66
"visualization",
@@ -30,6 +30,20 @@
3030
"sass":"^1.52.3"
3131
},
3232
"dependencies": {
33-
"@getbase/base":"^5.2.0"
33+
"@getbase/base":"^5.2.0",
34+
"@getbase/buttons":"^4.1.0",
35+
"@getbase/containers":"^4.2.1",
36+
"@getbase/forms":"^4.1.0",
37+
"@getbase/grid":"^4.1.0",
38+
"@getbase/layout-helpers":"^4.1.0",
39+
"@getbase/layout-spacers":"^4.1.0",
40+
"@getbase/tables":"^4.1.0",
41+
"@getbase/typography":"^4.1.1",
42+
"@getbase/typography-helpers":"^4.1.0"
43+
},
44+
"sass": {
45+
"includePaths": [
46+
"./node_modules"
47+
]
3448
}
3549
}

‎site.yaml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# General settings that will be available in templates.
22
site:
3-
base_url:http://localhost:8080
4-
disqus_shortname:null
5-
author:Author Name
6-
brand:Brand Name
3+
base_url:https://coderstats.net
4+
author:Ramiro Gómez
5+
brand:CoderStats
76

87

98
# Settings that affect collections in the document index. Top-level keys of

‎src/js/coder.js‎

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,26 @@ if (document.location.hash) {
1414
document.location.href='/';
1515
}
1616
// Set these values here because they are outside of vue's scope.
17-
document.title=`CoderStats(${github_user})`;
18-
document.getElementsByClassName('brand')[0].textContent=document.title;
17+
letshort_title=`CoderStats(${github_user})`
18+
document.title=document.title.replace('CoderStats',short_title);
19+
document.getElementsByClassName('brand')[0].textContent=short_title;
1920

2021
leturl_user=`https://api.github.com/users/${github_user}`,
2122
url_repos=`${url_user}/repos?sort=pushed&per_page=100`,
23+
url_issues=`https://api.github.com/search/issues?q=user:${github_user}&sort=updated&order=desc`,
2224
months_short='Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
2325

2426
if(DEV){
2527
url_user='/data/user.json';
2628
url_repos='/data/repos.json';
29+
url_issues='/data/issues.json';
2730
}
2831

2932
letcoder=newVue({
3033
el:'#coder',
3134
data:{
35+
activetab:'repos',
36+
latest_issues:null,
3237
repos:[],
3338
response:{},
3439
sort_orders:{},
@@ -56,6 +61,36 @@ let coder = new Vue({
5661
forks:function(){
5762
returnthis.repoRanking('forks_count');
5863
},
64+
repo_types:function(){
65+
letlabels=[];
66+
letvalues=[];
67+
lettypes={
68+
active_sources:0,
69+
archived:0,
70+
disabled:0,
71+
forked:0,
72+
mirrors:0
73+
};
74+
for(letrepoofthis.repos_pushed){
75+
if(repo.archived)
76+
types.archived++;
77+
elseif(repo.disabled)
78+
types.disabled++;
79+
elseif(repo.fork)
80+
types.forked++;
81+
elseif(repo.mirror)
82+
types.mirrors++;
83+
else
84+
types.active_sources++;
85+
}
86+
for(let[label,value]ofObject.entries(types)){
87+
if(value>0){
88+
labels.push(label);
89+
values.push(value);
90+
}
91+
}
92+
return{labels:labels,values:values};
93+
},
5994
stars:function(){
6095
returnthis.repoRanking('stargazers_count');
6196
},
@@ -98,8 +133,18 @@ let coder = new Vue({
98133
this.rankingGraph(this.issues.slice(0,10),'open_issues_count','#issues-ranking');
99134
this.rankingGraph(this.forks.slice(0,10),'forks_count','#forks-ranking');
100135
this.rankingGraph(this.stars.slice(0,10),'stargazers_count','#stars-ranking');
136+
137+
newChartist.Pie('#repo-types-chart',{
138+
labels:this.repo_types.labels.map(d=>d.replace('_',' ')),
139+
series:this.repo_types.values});
101140
},
102141
methods:{
142+
fetchIssues:function(){
143+
this.$http.get(url_issues).then(response=>{
144+
this.response.issues=response;
145+
this.latest_issues=response.body.items;
146+
});
147+
},
103148
fetchRepos:function(){
104149
this.$http.get(url_repos).then(response=>{
105150
this.response.repos=response;
@@ -129,11 +174,17 @@ let coder = new Vue({
129174
returnthis.repos_pushed.filter(d=>d[property])
130175
.sort((a,b)=>b[property]-a[property]);
131176
},
132-
sortBy:function(key,type='number'){
177+
showTab:function(name){
178+
this.activetab=name;
179+
if(!this.latest_issues){
180+
this.fetchIssues();
181+
}
182+
},
183+
sortBy:function(key,type='number',property='repos'){
133184
letdefault_value=type==='string' ?'' :0;
134185
this.sort_key=key;
135186
this.sort_orders[key]=(this.sort_orders[key]||1)*-1;
136-
this.repos.sort((a,b)=>{
187+
this[property].sort((a,b)=>{
137188
letx=a[key]||default_value,
138189
y=b[key]||default_value;
139190
if(type==='string'){

‎src/js/events.js‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎src/js/front.js‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp