mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-09-03 10:23:25 +00:00
feat: allow to customize wakatime range (#874)
* chore: allow to customize wakatime data range * docs: document wakatime range parameter docs: add wakatime section to german readme Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>
This commit is contained in:
co-authored by
Anurag Hazra
parent
922f7165cb
commit
24e5f866c0
@@ -1,11 +1,11 @@
|
||||
const axios = require("axios");
|
||||
|
||||
const fetchWakatimeStats = async ({ username, api_domain }) => {
|
||||
const fetchWakatimeStats = async ({ username, api_domain, range }) => {
|
||||
try {
|
||||
const { data } = await axios.get(
|
||||
`https://${
|
||||
api_domain ? api_domain.replace(/[^a-z-.0-9]/gi, "") : "wakatime.com"
|
||||
}/api/v1/users/${username}/stats?is_including_today=true`,
|
||||
}/api/v1/users/${username}/stats/${range || ''}?is_including_today=true`,
|
||||
);
|
||||
|
||||
return data.data;
|
||||
|
||||
Reference in New Issue
Block a user