Skip to content

Commit

Permalink
refactor: insight updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dvgamerr committed Nov 6, 2024
1 parent af25aa3 commit e8aaf46
Show file tree
Hide file tree
Showing 5 changed files with 1,141 additions and 1,138 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
${{ runner.os }}-node-
- name: Build 🔧
run: |
run: |
npm i
npm run build
Expand Down
55 changes: 29 additions & 26 deletions collector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ const collectGithubProjectStats = async () => {

let projectRepos = [];
for (const e of orgRepos) {
if (!e.owner) {
logger.debug('skip:', e);
continue;
}
if (
e.owner.login !== 'dvgamerr-app' ||
!e.description ||
Expand Down Expand Up @@ -141,34 +145,33 @@ const collectGithubProjectStats = async () => {
const repoTask = [];
const repoLangs = {};
for await (const e of repos) {
repoTask.push(
(async () => {
logger.trace(` - repos '${e.owner.login}/${e.name}'`);
const { data: contrib, status: statusContrib } = await getContributors(
e.owner.login,
e.name,
);
if (statusContrib === 200) {
for (const con of contrib) {
if (con.author.login !== 'dvgamerr') continue;
coding.commits += con.total;
if (e.owner)
repoTask.push(
(async () => {
logger.trace(` - repos '${e.owner.login}/${e.name}'`);
const { data: contrib, status: statusContrib } =
await getContributors(e.owner.login, e.name);
if (statusContrib === 200) {
for (const con of contrib) {
if (con.author.login !== 'dvgamerr') continue;
coding.commits += con.total;
}
}
}

const { data: langs, status: statusLangs } = await getLanguages(
e.owner.login,
e.name,
);
if (statusLangs === 200) {
for (const key in langs) {
repoLangs[key] = (repoLangs[key] || 0) + langs[key];

const { data: langs, status: statusLangs } = await getLanguages(
e.owner.login,
e.name,
);
if (statusLangs === 200) {
for (const key in langs) {
repoLangs[key] = (repoLangs[key] || 0) + langs[key];
}
coding.languages = [
...new Set(coding.languages.concat(Object.keys(langs))),
].sort();
}
coding.languages = [
...new Set(coding.languages.concat(Object.keys(langs))),
].sort();
}
})(),
);
})(),
);
}

logger.info(`Task Github API (${repoTask.length}) ...`);
Expand Down
14 changes: 7 additions & 7 deletions src/i18n/coding.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"total": 279,
"total": 289,
"private": 53,
"public": 226,
"public": 236,
"languages": [
"ApacheConf",
"Astro",
Expand Down Expand Up @@ -50,12 +50,12 @@
"Visual Basic",
"Vue"
],
"commits": 12764,
"commits": 2809,
"experience": "2013-04-29T00:00:00.000+07:00",
"updated": "2024-04-25T08:16:34.960Z",
"weekly_seconds": 878.4600382857143,
"average_seconds": 7093.90430141918,
"best_seconds": 46975.804539,
"updated": "2024-11-06T07:03:08.643Z",
"weekly_seconds": 15263.174888714286,
"average_seconds": 6876.822008975338,
"best_seconds": 41426.017768,
"loc": 0,
"daytime": [
714, 354, 97, 28, 10, 12, 10, 32, 140, 571, 998, 1110, 1132, 1230, 1393,
Expand Down
50 changes: 25 additions & 25 deletions src/i18n/experience.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"stargazers_count": 62,
"stargazers_count": 64,
"forks": 13,
"watchers": 62,
"watchers": 64,
"topics": [
"application",
"dougin-api",
Expand All @@ -44,7 +44,7 @@
"open-source",
"windows"
],
"pushed_at": "2024-04-17T11:01:43Z",
"pushed_at": "2024-05-01T11:37:57Z",
"created_at": "2017-08-01T09:18:50Z"
},
{
Expand All @@ -59,9 +59,9 @@
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"stargazers_count": 35,
"stargazers_count": 47,
"forks": 3,
"watchers": 35,
"watchers": 47,
"topics": [
"awards",
"bot",
Expand Down Expand Up @@ -94,9 +94,9 @@
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"stargazers_count": 4,
"stargazers_count": 5,
"forks": 0,
"watchers": 4,
"watchers": 5,
"topics": [
"cv",
"developer-resume",
Expand All @@ -108,7 +108,7 @@
"showcase",
"thongkam"
],
"pushed_at": "2024-04-25T07:56:56Z",
"pushed_at": "2024-11-06T06:05:14Z",
"created_at": "2021-04-04T12:57:01Z"
},
{
Expand Down Expand Up @@ -165,7 +165,7 @@
"web",
"web-gui"
],
"pushed_at": "2024-04-08T16:19:33Z",
"pushed_at": "2024-10-08T03:14:17Z",
"created_at": "2019-03-06T10:32:58Z"
},
{
Expand Down Expand Up @@ -203,7 +203,7 @@
"forks": 0,
"watchers": 0,
"topics": ["open-source"],
"pushed_at": "2024-03-28T01:44:36Z",
"pushed_at": "2024-08-30T17:34:09Z",
"created_at": "2024-03-27T10:33:47Z"
},
{
Expand Down Expand Up @@ -367,35 +367,35 @@
],
"coding": {
"bytes": {
"JavaScript": 13865042,
"JavaScript": 17750400,
"Vue": 1489652,
"HTML": 10714316,
"HTML": 10803541,
"Swift": 18084,
"Ruby": 199849,
"Ruby": 515339,
"Objective-C": 2024,
"Go": 3731010,
"Dockerfile": 99232,
"CSS": 2399264,
"Go": 3934380,
"Dockerfile": 99182,
"CSS": 2459625,
"Svelte": 21274,
"Shell": 667345,
"TypeScript": 4882194,
"Shell": 688652,
"TypeScript": 8301947,
"Makefile": 39512,
"Procfile": 27,
"SCSS": 221548,
"SCSS": 221958,
"C#": 2595093,
"Astro": 111606,
"Rust": 45620,
"Astro": 111633,
"Rust": 116727,
"PHP": 1643527,
"Hack": 7144,
"Dart": 102591,
"C++": 5751568,
"CMake": 188104,
"C": 123826,
"C": 124069,
"Kotlin": 1566977,
"Python": 570796,
"Python": 586360,
"Stylus": 41761,
"TSQL": 31522,
"Batchfile": 13888,
"Batchfile": 14191,
"Smarty": 20650,
"DataWeave": 1965,
"AutoHotkey": 9809376,
Expand All @@ -411,7 +411,7 @@
"M4": 19093,
"EJS": 64715,
"Jsonnet": 7419,
"Nix": 243,
"Nix": 486,
"Liquid": 686
},
"top5": [
Expand Down
Loading

0 comments on commit e8aaf46

Please sign in to comment.