Git Product home page Git Product logo

youeclipse / waka-box-go Goto Github PK

View Code? Open in Web Editor NEW
162.0 3.0 136.0 47 KB

📊 Update profile README / pinned gist to contain your weekly WakaTime stats. This is a Golang implementation, see the original version https://github.com/matchai/waka-box. 将你的 WakaTime 每周语言使用统计显示在 profile README / pined gist。

License: Apache License 2.0

Go 100.00%
wakatime-api wakatime pinned-gist weekly-wakatime-stats profile-readme profile

waka-box-go's People

Contributors

aarynsmith avatar overstarry avatar yeung66 avatar youeclipse avatar zu1k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

waka-box-go's Issues

wont run

what I did: changed the cron to run every minute, what it doesn't do:
update the gist.
I also checked actions and workflows and there was nothing there for update gists..
if anyone can help, I would appreciate it

cannot unmarshal number 1715.0 into Go struct field StatsData.data.daily_average of type int64

Still have the same issue as #37 on commit 4542143.

Full log is shown as below:

panic: wakabox.GetStats: Error getting Current Stats: unmarshal error  :json: cannot unmarshal number 1715.0 into Go struct field StatsData.data.daily_average of type int64

goroutine 1 [running]:
main.main()
	/home/runner/work/ZexinLi0w0/ZexinLi0w0/waka-box-go/cmd/box/main.go:48 +0x7d6
Error: Process completed with exit code 2.

panic: Insufficient statistics

2020-06-11T10:46:04.7903977Z ##[group]Run go run ./cmd/main.go
2020-06-11T10:46:04.7904193Z �[36;1mgo run ./cmd/main.go�[0m
2020-06-11T10:46:04.7944898Z shell: /bin/bash -e {0}
2020-06-11T10:46:04.7945053Z env:
2020-06-11T10:46:04.7945682Z   GH_TOKEN: ***
2020-06-11T10:46:04.7945831Z   GIST_ID: 33969f3f7686a55660aed171c790e34b
2020-06-11T10:46:04.7945976Z   GH_USER: Enoch2090
2020-06-11T10:46:04.7946148Z   WAKATIME_API_KEY: ***
2020-06-11T10:46:04.7946300Z   GOROOT: /opt/hostedtoolcache/go/1.14.4/x64
2020-06-11T10:46:04.7946461Z ##[endgroup]
2020-06-11T10:46:05.1089618Z go: downloading github.com/google/go-github v17.0.0+incompatible
2020-06-11T10:46:05.1209883Z go: downloading github.com/YouEclipse/wakatime-go v0.0.0-20200606100124-b1a24ffc7535
2020-06-11T10:46:07.0419088Z go: downloading github.com/google/go-querystring v1.0.0
2020-06-11T10:46:11.8196451Z panic: Insufficient statistics

我看 box.go 里写的,抛出这个错误应该是因为返回的列表里语言种类等于 0?但是我的 WakaTime Dashboard现在显示四种语言,会不会是 API 的问题?

关于执行的时间周期

我从原项目那里得知,wakaTime 的每周数据是按天来更新呢的,所以每小时执行的话其实也不会有更新 Gist 的显示(我当时看到 Github Action 执行了但是显示却没有更新数据,还以为是出什么问题了 😂

所以感觉执行周期改成每天一次更好?

cron: "0 0 * * *"

Update the profile README

As Github has a new feature of profile README, maybe waka-box-go can support updating the stats to profile README.

on way to update is adding a comment in the README and then update the comment area.
just like

<!--waka-box start -->
<!--waka-box end -->

Output: "Still Gathering Statistics..."

Hi, I am recently trying to use your project to get a waka-box in my README in Github profile. But when I finish every step in your introduction, I just get the "Still Gathering Statistics...", but when I check my WAKATIME dashboard, there are a lot of data in it, and I do enable the Display code time publicly and Display languages, editors, os, categories publicly.

The output in my README:

image

The Raw file:

image

But I am sure I set the secret token and other parameters right. And the GitHub action runs well.

My workflow config file:

name: Update wakatime stats

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: "5 0 * * *"

jobs:
  build:
    name: Update-waka-stats
    runs-on: ubuntu-latest
    env:
      WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
      GH_TOKEN: ${{ secrets.GH_TOKEN }}
      UPDATE_OPTION: GIST_AND_MARKDOWN
      MARKDOWN_FILE: README.md
      GIST_ID: ce41b***********************997b48
      GIST_BARSTYLE: SOLIDLT
      GIST_BARLENGTH: -1
      GIST_TIMESTYLE: SHORT

    steps:
      - name: Set up Go 1.x
        uses: actions/setup-go@v2
        with:
          go-version: ^1.14
        id: go
      - name: Check out repo
        uses: actions/checkout@v2
      - uses: actions/setup-go@v2
      - name: Clone and run waka-box
        run: |-
          git clone https://github.com/YouEclipse/waka-box-go.git
          cd waka-box-go && go build -o waka ./cmd/box/main.go
          mv ./waka ../ && cd .. && rm -rf waka-box-go/
      - name: Commit and push
        run: |-
          ./waka
          git config --global user.email "[email protected]" && git config --global user.name "Waka-Bot"
          git diff
          git add README.md && git commit -m ":memo: update profile" || exit 0
          git pull && git push

Gist 似乎没有更新

创建 Gist 的时候随手输入了 Hello,所有步骤完成后,Gist 没有更新,我遗漏了什么吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.