diff --git a/collector/index.js b/collector/index.js index 572df55..4291b05 100644 --- a/collector/index.js +++ b/collector/index.js @@ -16,6 +16,7 @@ const { const args = arg({ '--github': Boolean, '--wakatime': Boolean, + '--file': String, }); const enableGithub = args['--github'] && process.env.GH_TOKEN @@ -185,8 +186,6 @@ const collectWakaTime = async () => { coding.average_seconds += totalDuration if (i > idx - 7) { coding.weekly_seconds += totalDuration - - dateDuration } if (coding.best_seconds < totalDuration) coding.best_seconds = totalDuration @@ -203,8 +202,12 @@ const collectWakaTime = async () => { coding.weekly_seconds = coding.weekly_seconds / 7 coding.weektime = coding.weektime.map(e => e.duration / e.count) + if (!args['--file']) { + delete coding.daytime + } logger.debug(coding) + await mergeJsonResponse(coding, './src/i18n/coding.json') await mergeJsonResponse(body, './src/i18n/insights.json') // for (let i = totalDay; i >= 0; i--) { @@ -281,7 +284,7 @@ const getCitibankUSD = async () => { } Initializes().then(() => Promise.all([ - // collectGithubProjectStats(), + collectGithubProjectStats(), getCitibankUSD(), collectWakaTime(), ])).then((res) => { diff --git a/package.json b/package.json index eb74835..8388a08 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "dev": "astro dev", "start": "astro dev", "build": "astro build", + "collector:gh": "node ./collector/index.js --github | pino-pretty", + "collector:wk": "node ./collector/index.js --wakatime --file D:/home/Downloads/wakatime-info.dvgamergmail.com-06633b1c3ba744c2ab5d08e47ccc87ab.json | pino-pretty", "collector": "node ./collector/index.js --wakatime --github | pino-pretty", "astro": "astro" }, diff --git a/src/i18n/coding.json b/src/i18n/coding.json index 8721e74..1ba5637 100644 --- a/src/i18n/coding.json +++ b/src/i18n/coding.json @@ -1,6 +1,6 @@ { "total": 219, - "private": 3, + "private": 49, "public": 216, "languages": [ "JavaScript", @@ -53,9 +53,9 @@ "commits": 3453, "experience": "2013-04-29T00:00:00.000+07:00", "updated": "2024-03-06T10:15:42.843Z", - "weekly_seconds": 7317.49946, - "average_seconds": 7058.645887263014, - "best_seconds": 44422.207450999995, + "weekly_seconds": 17421.754013714286, + "average_seconds": 7098.943936191781, + "best_seconds": 46975.804539, "loc": 0, "daytime": [ 69, @@ -86,8 +86,8 @@ "weektime": [ 7387.844356711541, 10491.952919365383, - 8996.180162358487, - 9303.651937615385, + 9188.293258788459, + 9173.31216245283, 6895.8477763461515, 3726.3331686538468, 2789.1322143653842 diff --git a/src/i18n/experience.json b/src/i18n/experience.json index 4d5f73c..981fb30 100644 --- a/src/i18n/experience.json +++ b/src/i18n/experience.json @@ -4,7 +4,7 @@ "currencry": { "ccy": "USD", "sell": 35.92, - "buy": 35.41 + "buy": 35.3 }, "salary": { "base": 71950, diff --git a/src/i18n/insights.json b/src/i18n/insights.json index 5da5850..9ec09a6 100644 --- a/src/i18n/insights.json +++ b/src/i18n/insights.json @@ -1,20 +1,6 @@ { "data": { "days": [ - { - "date": "2023-03-08", - "total": 521.075104, - "categories": [ - { - "name": "Coding", - "total": 521.075104 - }, - { - "name": "Debugging", - "total": 0 - } - ] - }, { "date": "2023-03-09", "total": 5845.748157, @@ -5099,11 +5085,25 @@ }, { "date": "2024-03-06", - "total": 30262.969648, + "total": 31777.745604, + "categories": [ + { + "name": "Coding", + "total": 31777.745604 + }, + { + "name": "Debugging", + "total": 0 + } + ] + }, + { + "date": "2024-03-07", + "total": 2395.643854, "categories": [ { "name": "Coding", - "total": 30262.969648 + "total": 2395.643854 } ] }