File tree Expand file tree Collapse file tree 4 files changed +24
-11
lines changed
Expand file tree Collapse file tree 4 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,24 @@ Automatically updates your GitHub bio with your WakaTime stats every 15 minutes
44
55## Installation
66
7+ ### Usage
8+
791 . Clone the repo: ` git clone https://github.com/Dev-CasperTheGhost/update-github-bio `
8102 . Install the dependencies: ` npm install `
9113 . Copy and rename ` .env.example ` to ` .env `
10124 . Update your credentials in ` .env `
1113 - GitHub token: < https://github.com/settings/tokens > make sure to select the ` user ` scope
1214 - WakaTime api key: < https://wakatime.com/settings/api-key >
15+ 5 . Start it! ` npm run start `
16+ 6 . It should be running if nothing was returned!
17+
18+ ### Running for 24/7
19+
20+ You can use [ ` pm2 ` ] ( https://www.npmjs.com/package/pm2 ) to start this process in the background
21+
22+ 1 . Make sure that you have followed the steps above
23+ 2 . Install pm2 globally: ` npm install -g pm2 `
24+ 3 . Start it! ` pm2 start npm --name github-bio --run start `
1325
1426## License
1527
Original file line number Diff line number Diff line change 44 "description" : " Automatically updates your GitHub bio with your WakaTime stats every 15 minutes" ,
55 "main" : " src/index.ts" ,
66 "scripts" : {
7- "dev" : " nodemon src/index.ts"
7+ "dev" : " nodemon src/index.ts" ,
8+ "start" : " ts-node src/index.ts"
89 },
910 "keywords" : [],
1011 "author" : " Dev-CasperTheGhost" ,
1415 "dotenv" : " ^8.2.0"
1516 },
1617 "devDependencies" : {
17- "@types/node" : " ^14.14.22 " ,
18+ "@types/node" : " ^14.14.31 " ,
1819 "nodemon" : " ^2.0.7" ,
1920 "ts-node" : " ^9.1.1" ,
20- "typescript" : " ^4.1.3 "
21+ "typescript" : " ^4.2.2 "
2122 }
2223}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ async function getWakatimeTotalTime(): Promise<string | undefined> {
1717 method : "GET" ,
1818 url : ENDPOINTS . WAKATIME ,
1919 params : {
20- api_key : process . env . WAKATIME_API_KEY ,
20+ api_key : process . env [ " WAKATIME_API_KEY" ] ,
2121 scope : "read_logged_time" ,
2222 start : new Date ( Date . now ( ) ) ,
2323 end : new Date ( Date . now ( ) ) ,
@@ -41,7 +41,7 @@ async function updateBio(message: string) {
4141 url : ENDPOINTS . GITHUB ,
4242 headers : {
4343 Accept : "application/vnd.github.v3+json" ,
44- Authorization : `token ${ process . env ?. GH_TOKEN } ` ,
44+ Authorization : `token ${ process . env [ " GH_TOKEN" ] } ` ,
4545 } ,
4646
4747 data : {
You can’t perform that action at this time.
0 commit comments