Skip to content

Commit e906291

Browse files
committed
🔨 chore: updated README
1 parent 94d58c7 commit e906291

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
79
1. Clone the repo: `git clone https://github.com/Dev-CasperTheGhost/update-github-bio`
810
2. Install the dependencies: `npm install`
911
3. Copy and rename `.env.example` to `.env`
1012
4. 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

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
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",
@@ -14,9 +15,9 @@
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
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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: {

0 commit comments

Comments
 (0)