# Wakatime integration

**URL:** <https://forum.beeminder.com/t/wakatime-integration/3429>\
**Category:** Tech\
**Created:** [August 13, 2017, 6:24pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429 "2017-08-13T18:24:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcool](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bcool](https://forum.beeminder.com/u/bcool)\
**Post date:** [August 13, 2017, 6:24pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/1 "2017-08-13T18:24:02Z")

</div>

Is it already possible to connect to [wakatime.com](http://wakatime.com) and setup a beeminder with it?

---

<div class="post-metadata">

**Author:** ![dreev](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/dreev/32/4311_2.png) [@dreev](https://forum.beeminder.com/u/dreev)\
**Post date:** [August 14, 2017, 12:07am UTC](https://forum.beeminder.com/t/wakatime-integration/3429/2 "2017-08-14T00:07:04Z")

</div>

Not yet but this one may be coming soon! Would you like to help with it?

UPDATE: [wakatime integration](https://www.beeminder.com/wakatime) is now live!

---

<div class="post-metadata">

**Author:** ![bcool](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bcool](https://forum.beeminder.com/u/bcool)\
**Post date:** [August 14, 2017, 3:52pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/3 "2017-08-14T15:52:59Z")

</div>

I would like to help, but I have the assumption this takes more than 5 hours with my skill level of programming… therefor I think it’s better if someone with a bit more experience fixes this… But I’m eager to see if I can understand what is needed to fix this…

---

<div class="post-metadata">

**Author:** ![wswld](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/wswld/32/1565_2.png) [@wswld](https://forum.beeminder.com/u/wswld)\
**Post date:** [March 18, 2018, 9:16pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/4 "2018-03-18T21:16:32Z")

</div>

@dreev I’m also in great need for this and instead of developing and hosting my own solution, it could be beneficial to contribute to the existing one, if I could have a look at other integration code.

---

<div class="post-metadata">

**Author:** ![dreev](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/dreev/32/4311_2.png) [@dreev](https://forum.beeminder.com/u/dreev)\
**Post date:** [March 19, 2018, 10:05pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/5 "2018-03-19T22:05:21Z")

</div>

That would be awesome. We aspire to get this really streamlined where you can follow the template of an existing integration and have it be super straightforward. We’re not there yet but you could help us get a little closer… First step would be to sign our CLA before looking at our other official integrations: [beeminder.com/cla](http://beeminder.com/cla)

---

<div class="post-metadata">

**Author:** ![nectar](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/nectar/32/1719_2.png) [@nectar](https://forum.beeminder.com/u/nectar)\
**Post date:** [March 21, 2018, 9:36am UTC](https://forum.beeminder.com/t/wakatime-integration/3429/6 "2018-03-21T09:36:34Z")

</div>

> [@wswld](#):
>
> it could be beneficial to contribute to the existing one, if I could have a look at other integration code.

All the [Beemind.me](http://Beemind.me) and Nectar integration’s are open source:

- [Google Fit](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/googlefit_adapter.rb)
- [Trello](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/trello_adapter.rb)
- [Pocket](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/pocket_adapter.rb)
- [Beeminder](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/beeminder_adapter.rb)
- [Quizlet](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/quizlet_adapter.rb)
- [Austin Bcycle](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/bcycle_adapter.rb)
- [Stack Overflow](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/stackoverflow_adapter.rb)
- [Typeracer](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/typeracer_adapter.rb)
- [Facebook](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/facebook_adapter.rb)
- [Instagram](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/instagram_adapter.rb)
- [Twitter](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/twitter_adapter.rb)
- [Flickr](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/flickr_adapter.rb)
- [Wikipedia](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/wikipedia_adapter.rb)
- [World Community Grid](https://github.com/beeminder-capstone/Nectar-Backend/blob/develop/app/adapters/worldcommunitygrid_adapter.rb)

The Nectar web and mobile apps provide a framework in which developers can easily create new integrations and add metrics to the 32 existing integration providers. There are detailed instructions [here](http://forum.beeminder.com/t/new-mobile-app-android-ios-windows-plus-7-new-integrations/3421) (click on the third “Developers”) if you are interested.

---

<div class="post-metadata">

**Author:** ![wswld](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/wswld/32/1565_2.png) [@wswld](https://forum.beeminder.com/u/wswld)\
**Post date:** [April 17, 2018, 6:10am UTC](https://forum.beeminder.com/t/wakatime-integration/3429/7 "2018-04-17T06:10:58Z")

</div>

I said that because I’m a pythonista and if I understand correctly Beeminder is written in Ruby. I have enough commercial experience to work with virtually any common language (did a minor PHP project, lots of JS/React on the side) but I may need to see how some of the similar integrations are written not to do anything stupid.

---

<div class="post-metadata">

**Author:** ![leo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/leo/32/2335_2.png) [@leo](https://forum.beeminder.com/u/leo)\
**Post date:** [December 12, 2018, 7:28am UTC](https://forum.beeminder.com/t/wakatime-integration/3429/8 "2018-12-12T07:28:14Z")

</div>

I hope you are cool with me reviving this 🙂

What is the current state of the Wakatime integration?

Most people that want to learn to code, want to put in a certain daily programming time every day instead of focusing on for example Github commits.  
Is there any other automatic way besides Wakatime to do this?

I’m just getting into programming, but would be more than happy to commit to help to develop this integration, if I can be of any use. My normal programming happens at the moment only in Python, but I guess, that learning Ruby on Rails wouldn’t hurt 🙂

Edit1: Typos  
Edit2: Okay, maybe I posted a little bit too fast, sorry about that. I just discovered rescue time and it should perfectly do the job. I would like to start contributing nevertheless as soon as I am able to do so @dreev talked about a streamlined way of getting involved and following a template. Is there already a guide for developers or anything like this available?

---

<div class="post-metadata">

**Author:** ![adamwolf](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/adamwolf/32/484_2.png) [@adamwolf](https://forum.beeminder.com/u/adamwolf)\
**Post date:** [December 12, 2018, 12:08pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/9 "2018-12-12T12:08:45Z")

</div>

One way would be to use RescueTime, set up to count time in your IDE or something!

---

<div class="post-metadata">

**Author:** ![leo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/leo/32/2335_2.png) [@leo](https://forum.beeminder.com/u/leo)\
**Post date:** [December 12, 2018, 1:39pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/10 "2018-12-12T13:39:19Z")

</div>

Thank you for your response @adamwolf !  
I already have everything set up 🙂

---

<div class="post-metadata">

**Author:** ![b2019](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@b2019](https://forum.beeminder.com/u/b2019)\
**Post date:** [December 30, 2018, 6:02pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/11 "2018-12-30T18:02:37Z")

</div>

I would also love to see a Wakatime integration. They have a nice, easy to use API.

---

<div class="post-metadata">

**Author:** ![mattioo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/mattioo/32/3778_2.png) [@mattioo](https://forum.beeminder.com/u/mattioo)\
**Post date:** [September 29, 2020, 7:39am UTC](https://forum.beeminder.com/t/wakatime-integration/3429/12 "2020-09-29T07:39:52Z")

</div>

I was about to create a new subject asking for integrating Wakatime when I saw there was one already. I think it is much better Wakatime than rescuetime, because it makes data entry automatic ! I’m also a Pythonistas and I would have loved to help, maybe I can still try to integrate it with ruby. Any advice ?

---

<div class="post-metadata">

**Author:** ![brettyance](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/brettyance/32/3779_2.png) [@brettyance](https://forum.beeminder.com/u/brettyance)\
**Post date:** [September 29, 2020, 6:14pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/13 "2020-09-29T18:14:55Z")

</div>

@mattioo What I do is use rescuetime’s “alert” function as a trigger in IFTTT to send a datapoint to Beeminder. Alternatively, Beeminder does have automated data entry for RescueTime’s usage of certain tasks including time in a certain IDE. Would that suffice for your purposes? I haven’t used Wakatime, so I don’t know what you would be missing out on if you were to use what I’ve suggested.

---

<div class="post-metadata">

**Author:** ![narthur](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/narthur/32/5113_2.png) [@narthur](https://forum.beeminder.com/u/narthur)\
**Post date:** [September 29, 2020, 6:24pm UTC](https://forum.beeminder.com/t/wakatime-integration/3429/14 "2020-09-29T18:24:56Z")

</div>

For a while I used some custom python to connect wakatime with beeminder, feel free to take whatever you like:

Wakatime wrapper:

```auto
import requests
import datetime

class WakaTime:
    _key = "[your api key here]"

    def get_projects(self):
        date_string = datetime.datetime.now().strftime("%Y-%m-%d")
        base = "https://wakatime.com/api/v1/users/current/"
        endpoint = f"{base}summaries?start={date_string}&end={date_string}&api_key={self._key}"
        response = requests.get(endpoint)

        return response.json()['data'][0]['projects']

```

Sync job:

```auto
from pyminder.beeminder import Beeminder

from airtimer.croniter import Croniter
from airtimer.job import Job
from airtimer.python import Python
from airtimer.wakatime import WakaTime

class Script(Job):
    # Every hour
    _schedule = '0 * * * *'

    _beeminder: Beeminder
    _wakatime: WakaTime

    def __init__ (
            self,
            beeminder: Beeminder,
            croniter: Croniter,
            python: Python,
            wakatime: WakaTime
    ):
        super(). __init__ (croniter, python)

        self._beeminder = beeminder
        self._wakatime = wakatime

    def run(self):
        projects = self._wakatime.get_projects()
        goals = self._beeminder.get_goals()
        goal_names = [g['slug'] for g in goals]
        filtered_projects = [p for p in projects if f"waka-{p['name']}" in goal_names]

        for project in filtered_projects:
            self._beeminder.create_datapoint(
                f"waka-{project['name']}",
                project['total_seconds'] / 60 / 60,
                self._python.time_now()
            )

```
