Changing autodata source to Runkeeper

As previously mentioned, the Strava integration seems to have died. So I need to switch my exercise distance goals to Runkeeper.

The Runkeeper blog post seems to indicate that I should be able to do that myself:

“You can track the distance, duration, or frequency of your running, walking, cycling, any subset of those activities, or of the union of all your RunKeeper fitness activities. You can also turn this on for an existing Beeminder goal in the settings — just first authorize us to pull your RunKeeper data in Your Account >> Services.”

I can’t work out how to do it though. Possibly the blog post was referring to existing Runkeeper Beeminder goals? Just in case the data source does need to be changed by support, the slugs are walkdistance, bikedistance and rundistance. I would prefer to be able to enter data manually to these goals as well as getting the autodata from Runkeeper. Is that possible?

2 Likes

You can

  1. mail support@beeminder.com
  2. try the following
    a) create a new goal with RunKeeper as source
    b) export your data from the Strava goal
    c) import your Strava data to the RunKeeper goal via e-mail (bot@beeminder.com)
  3. sync Strava with RunKeeper with Tapiriik https://tapiriik.com and then create the RunKeeper goal (although I’m not sure if when you create a new RK goal, Beeminder gets all the historical data)

In general, you can add data manually even on goals with automated sources, by mailing bot@beeminder.com
The format is 2014 06 28 123 “optional comment”

4 Likes

If you have less that 100 Strava Activities per month Zapier is free and seems to be working very efficiently (in fact better than my previous solution of Strava → Tapirik → Runkeeper → Beeminder) and it is always there after a max of 15 minutes, it is working better than the previous integration ever did.

If you don’t care about having your units in meters you can just use the basic Strava direct to Beeminder Zap, however if you prefer Km or Miles you’ll have to do it using the Code for Zapier.

Here is a quick tutorial.

Step 1: Set up a new Zap with Strava Beta and Code by Zapier as the trigger and action. Authorize your Strava Account with Zapier.

Step 2: Set up the filter for activities you want to go through to this goal. There is opportunity for great customisation here, below is a simple one to filter just for Rides (see Strave API Reference for Activities and scroll down to Activity Types for a full list.

Step 3: Set up the input fields exactly as below.

Step 4: Paste the following code in the code section, replacing the top 3 variables with your ones. (Note this is the first Javascript I have ever written, it probably breaks every rule there is and is stupidly done, but to works! :grinning: )

var auth_token = "authtoken"; //Get from https://www.beeminder.com/api/v1/auth_token.json .
var username = "username"; //Your Username
var goalname = "goalslug"; //The Goal Slug

var posturl = "https://www.beeminder.com/api/v1/users/" + username + "/goals/" + goalname + "/datapoints";
 
var distanceKM = parseFloat(input.distance) / 1000.0; //Change to a division factor of your choice e.g. 1609.34 for miles
var comment = input.name + " at " + input.time; //Change to a format of your choice.
 
var payload = { 
  "auth_token": auth_token,
  'value': parseFloat(distanceKM.toFixed(2)), //Cleaning up to 2 decimal places.
  'comment':  comment,
  'requestid': input.id, //Uses the Strava Activity ID as the Beeminder Unique ID to remove any possible chance of duplicate datapoints if you change the Strava activity after it has already Zapped.
};

fetch(posturl, {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify(payload)
  }).then(function(response) {
    return response.text();
  }).then(function(responsebody) {
    var output = {response: responsebody};
    callback(null, output);
  }).catch(function(error) {
    callback(error);
  });

Step 5: Test it with one of the sample activities Zapier provides (you can delete it in Beeminder afterwards by going to All Data).

Step 6: Save the Zap and activate it. Rinse and repeat for each goal and/or activity type you want.

Step 7: Get out there in the Winter’s air and do some exercise! :smile:

Hope that helps if you prefer to stick with direct Strava → Beeminder.

6 Likes

Thanks for all the tips and ideas everyone! I got a report today that we might have a bug with our Zapier integration for new users trying to authorize Zapier to use their beeminder account, though! I’ll have to check up on that. And thanks @peppertoni for pointing out that the RunKeeper blog post is out of date. You can no longer add RunKeeper to goals in the advanced settings (nor withings.)

1 Like