Giter VIP home page Giter VIP logo

wakatime-hours's Introduction

Wakatime Hours


Important

In order to display your statistics you need to host this API yourself, for this I recommend using Deno Deploy.

Note

Don't forget to replace example YOUR-DEPLOY parameter with real value.

๐Ÿ–ฅ๏ธ Hosting with Deno Deploy

  1. Fork this repository
  2. Go to Deno Deploy and connect your GitHub account
  3. Click New Project and select your forked repository
  4. Select main branch
  5. Add WAKATIME_API_KEY environment variable with your Wakatime API Key
  6. Click Link
  7. Visit https://YOUR-DEPLOY/api/badge in your browser

๐Ÿ”ฉ Self Hosting

  1. Clone this repository git clone https://github.com/IgorKowalczyk/wakatime-hours
  2. Create new file named .env Remember - the file is super secret, better to not share it.
  3. In .env file set this values:
    • WAKATIME_API_KEY - Your Wakatime API Key
    • PORT - Port on which the API will be available (optional, default: 8080)
  4. Run deno task dev to start the project in development mode or deno task start to run the project in production mode.
  5. Visit http://localhost:8080 in your browser (or http://localhost:${PORT} if you set custom port)

โ–ฒ Hosting with Vercel

Warning

This API no longer supports Vercel hosting. But if you want to host this API on Vercel, you can use old version of this API (>= 2.x.x) which is available here.

The old version of this API is no longer supported and will not receive any updates!

๐Ÿ—œ๏ธ API Usage

GET https://YOUR-DEPLOY/api/badge?style=${style}&color=${color}&label=${label}
Parameter Type Description Available values Default value
style string Optional. The style of the badge Available styles flat
color string Optional. The color of the badge Available colors blue
label string Optional. The label of the badge Any string Wakatime

๐Ÿ–ผ๏ธ Available styles

Note

The default style is flat

Style Example Usage
flat style=flat
flat-square style=flat-square
for-the-badge style=for-the-badge
plastic style=plastic
social style=social

Note

To apply the style, add to the URL ?style=YOUR-STYLE, if you use other parameters you can use &style=YOUR-STYLE

๐ŸŽจ Custom colors

Note

The default color is blue

Color Example Usage Label Color Label usage
brightgreen color=brightgreen labelColor=brightgreen
green color=green labelColor=green
yellow color=yellow labelColor=yellow
yellowgreen color=yellowgreen labelColor=yellowgreen
orange color=orange labelColor=orange
red color=red labelColor=red
blue color=blue labelColor=blue
grey color=grey labelColor=grey
lightgrey color=lightgrey labelColor=lightgrey
blueviolet color=blueviolet labelColor=blueviolet
ff69b4 color=ff69b4 labelColor=ff69b4

Note

To apply the style, add to the URL ?color=YOUR-COLOR, if you use other parameters you can use &color=YOUR-COLOR

Warning

HEX colors should be used without # symbol prefix.

๐Ÿ“ Custom text

You can overwrite default Wakatime text with your own label.

Note

Replace whitespace with + character in multi-word labels.

![Wakatime Hours](https://YOUR-DEPLOY/api/badge?label=Your+own+label)

๐Ÿ“Š Getting Wakatime API Key

  1. Go to Wakatime and login to your account
  2. Go to API Keys page and copy your API Key
  3. Paste your API Key to .env file or add it as environment variable on your hosting
  4. Restart your API if needed

Important

Wakatime API Key is super secret, better to not share it. If you share it, anyone can use your API Key to get or modify your statistics.

โ‰๏ธ Issues

If you come across any errors or have suggestions for improvements, please create a new issue here and describe it clearly.

๐Ÿ“ฅ Pull Requests

When submitting a pull request, please follow these steps:

  • Clone this repository https://github.com/IgorKowalczyk/wakatime-hours.git
  • Create a branch from main and give it a meaningful name (e.g. my-awesome-new-feature).
  • Open a pull request on GitHub and clearly describe the feature or fix you are proposing.

๐Ÿ“‹ License

This project is licensed under the MIT. See the LICENSE file for details

wakatime-hours's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.