Simple shell script to submit auto data

I’ve put together a simple shell script which makes use of the Beeminder API to submit data points to a goal.

Usage

Download the shell script.

  1. Make sure it is executable (chmod +x beemind.sh).
  2. Add your AUTH_TOKEN.
  3. Add your GOAL slug.
  4. Add a shell command which returns a VALUE.
  5. Add it to your job scheduler (eg cron).

Enjoy simple, local, self contained autodata submission.

7 Likes

Cool! Thanks for publishing that. Looks great for making custom autodata goals.

If you’ll only ever use a script to enter datapoints, there’s a Data Source field at the bottom of the Terrifyingly Advanced settings tab that lets you specify that a goal is autodata via an API call. Currently this has the side-effect of setting your goal deadline to midnight, and the deliberate effect of hiding the manual data entry form.

For general-purpose command-line data-entry, I use a fork of lydgate’s bmndr python script.

2 Likes

Why would you want to do this?

  • Changing the goal deadline as a side-effect seems really evil.
1 Like

I’ve got 40 active goals. Automating as many as possible is good. It’s also good if Beeminder treats my hand-rolled automated goals in the same way that it treats ‘official’ auto-data goals. Hence changing the data source setting to ‘api’. Notably, it removes the goal from the Quick Add Data dropdown on the goal gallery web page, which makes it quicker to locate the right goal if I’m using that method of data entry.

The changing of the goal’s deadline for api-driven goals is a temporary (and probably unnecessary) artefact of not yet allowing arbitrary deadlines on auto-data goals. (Because some services don’t give anything other than a calendar-date daily total.) I mentioned it for completeness.

1 Like

Fear not, we’re merely lazy! We’re not doing the thing you’ve rightly (if overstatedly) identified as evil. Namely, we don’t let you change autodata deadlines currently, since it’s a can of worms with (some of) our integrations. But we don’t change it on you if you already have it set.

Unless @pjh knows more than me and Beeminder actually treats midnight as the deadline (when autodata/API = true) even if it’s displaying something else. That would be an urgent bug so definitely holler if you think you may have seen such a thing.

(@dreev,@pjh) Thanks guys.
I’ve not noticed any specific bugs yet.
I think I’ll leave my goals set to manual for now as I don’t have too many yet so I’m still manually curating them until I’m confident that my autodata submissions are working as expected.

1 Like

Good catch, @dreev! Confirmed: we continue to display the user-specified deadline everywhere, even after greying out the field. Unconfirmed: what’s the actual enforced deadline? I may have assumed it’d be midnight (because now auto-data) rather than actually testing.

Looking at my own goals, none of my Zapier or API fuelled goals care about dates; they all record an incremental datapoint for ‘right now’. Feels to me as though user-rolled integrations should be able to decide for themselves whether their deadlines need to be midnight. (Though there’s always the danger that I’d forget the reasoning later and change it on myself. But there’s a reason that deadlines are on the Terrifyingly Advanced tab…)

Nicely put. Hanlon’s razor definitely applies; always assume ignorance, laziness, and shortage of tuits rather than evil intent.

1 Like

Also, it seems that we attempt to ‘fetch’ data on goals marked as API-fuelled. Not every time, maybe the first page-load of the day if there’s no datapoint for that day. It makes sense for official auto-data, but not for Zapier, or API goals where the datapoints are invariably pushed to Beeminder.

Symptom: a spurious rebraining, complete with infinibee, and a blue banner saying that we’re fetching data. It most often happens to me when I want to take a look at my graph to see how much I need to do that day; i.e. always before I’ve entered a datapoint on that goal!

tags: bugabee @dreev

1 Like