IFTTT Triggers can pass data on to Actions (IFTTT calls this data Trigger Ingredients).
Some of those data types are things that a person might want to beemind, but they’re not necessarily in a format that the Beeminder Add Datapoint Action recognizes, so rather than try to be overly clever and make guesses about what you meant and if you meant it, we’ve added in some macros for the Value field.
Trigger Ingredients
First lemme provide a little illustration of what I’m talking about with Trigger Ingredients, and how to find them. Setting up an IFTTT recipe from scratch, when you get to the THAT, you’ll find Trigger Ingredients by clicking on the blue erlenmeyer flask that shows up when you click on a text field.
When you pick an Ingredient it then gets subbed into the field like this:
Now if you were to send this time ingredient to Beeminder as the value for your datapoint, it would generate an error. This is where our macros come in. So far we’ve noticed two types of Trigger data that people commonly want to send to Beeminder, and made macros.
TOD[]
Say you want to use the time-of-day part of a full DateTime string, e.g., the IssueClosedAt Ingredient I used in the Github example above. Or more likely useful, the AwokeAt Ingredient from Fitbit’s “New Sleep Logged” Trigger. We’ve seen people using the time from this ingredient for “Do Less oversleeping” goals, for example.
Use:
In the Add Datapoint Action’s “Value” field, wrap the Trigger Ingredient with TOD[]
, so e.g., TOD[{{AwokeAt}}]
. (Originally we called this “pumpkin” so that’s what the image shows and both now work.)
Then when we get a string TOD[May 12, 2015 at 06:30AM]
, we will throw away the rest of the date portion and use only the time, 6:30, and submit that to Beeminder just as when you submit 6:30 through the web interface (Beeminder interprets it as 6.5).
HMS[]
IFTTT Triggers also sometimes provide a duration value, e.g., in the case of Fitbit Sleep again, we have TimeAwake, which is the duration of the time Fitbit figures you were actually awake, despite being in sleep mode. This is typically a string that looks like “30m”, or “6h 23m”.
Use:
In the Add Datapoint Action’s “Value” field, wrap the Trigger Ingredient with HMS[]
, e.g., HMS[{{AwakeTime}}]
.
Then when we see HMS[]
submitted for a Beeminder value from IFTTT, we get rid of the d,h,m,or s
part and turn it into a value that Beeminder recognizes, e.g. 6h 23m => 6:23 => 6 + 23/60
.
NUM[]
Say you have GoodReads autotweeting your page number and you want to send that to Beeminder. But the tweet is something like “Bethany is on page 54 of 512 of…”. You want to grab just that first “54”.
Use:
In the Add Datapoint Action’s “Value” field, wrap the Trigger Ingredient for the tweet text in NUM[]
like NUM[{{Text}}]
.
SUM[]
We don’t know if you’d ever need this but it sounds theoretically useful! If you wrap a Trigger Ingredient in SUM[]
then we’ll parse out all the numbers and sum them up and send that along to Beeminder!
PROD[]
And the same for multiplying, because @peppertoni has a great use case for this with assigning points per minute of different activities.
WORDCOUNT[]
Counts the words between []. So WORDCOUNT[Alpha, Beta, Gamma, Delta, Epsilon]
would count 5 words.
CHARCOUNT[]
Same but counts all the characters.
This post is a wiki. Let us know what other macros would be useful!