InsightTimer.com - API python script (meditation tracking)

I have started to get a new error that I think spawns from me moving from China back to the US. When I run the script I see this in cmd:

Any ideas?

1 Like

Does your config.ini look like this? Based on the error, it looks like your missing the ā€œutc_timezoneā€ parameter that was added to the script.

[insight]
username=username
password=p@ssword
# This should be your UTC offset. I'm in the pacific U.S. timezone, so that's -8.
utc_timezone=-8 

[beeminder]
username=username
auth_token=123abc123abc
goal_name=some_goal
```
3 Likes

That did it.

Thank you very much.

1 Like

I started trying to use this today and found that it broke when trying to call the function csv_to_todays_minutes, because it was expecting the duration entries in the csv to just be integers representing minutes, when the csv I get from Insight timer uses the format hh:mm:ss.

I have fixed this in my fork of this code, which can be found at https://github.com/benkloester/beesight

I can think of a couple of other useful additions to this code, if anyone else out ther is using it Iā€™d be more motivated to make them:

  • better timezone support (eg dealing with daylight savings)
  • rather than just scanning the last 4 log entries and adding the minutes from today, you could actually do full-blown sync of the insight timer entries to beeminder. That is, keep track of whatever the last log entry submitted was, and submit one beeminder datapoint for each new entry since that, with the timestamps set to match.
1 Like

Ah, nice work. I could definitely use this. I would love it to do real syncing, but I bet this will work good enough for me.

You know what would be mediumly-slick? Is if this was rejiggered to work with Beeminderā€™s autofetch API. I have a few examples using Python on Glitch, like my Marvin integration: glitch.com/edit/#!/beemind-marvin3 . I havenā€™t yet made one that supports multiple users, but each user could always ā€œremix itā€.

(Have you used Glitch before? For things like this, itā€™s one of my favorite ways to get something running online.)

Let me know what you think.

1 Like

I accidentally did this. https://github.com/adamwolf/beesight

1 Like

Nice work!

I also made a Java version that is slicker (handles duplicates very well) if you check my other repos.

Haha, now Iā€™m gonna have to go and look at what Glitch is.

Sometime in the last few days, the CSV export moved to https://profile.insighttimer.com/sessions/export. This will likely need to be fixed in a lot of peopleā€™s integrations. The login method may have changed as well.

Does anyone feel like providing step-by-step instructions for a clueless person on how to do this? Clueless as in: What is API? A python is a snake, right?
But I can follow instructions, promise. Iā€™m on a mid-2013 Mac, if that matters.
Thank you kindly in advance.