quiznoob — connect to Circle via IFTTT

John Callahan
5 min readFeb 5, 2018

--

Now that you have the quiznoob server up and running (see Part 1), you’ll need to connect it to Circle via IFTTT (if THIS then THAT). Basically, you need to create an applet such that IF a webhook receives a message (the “trigger”), THEN you’ll reward your child on Circle (the “action”). First, create an account at IFTTT and click the “New Applet” button:

You now see the “New Applet” screen:

Click on the word “+THIS” to configure the trigger and you’ll then see a list of services for creating your trigger:

Start typing “webhooks” into the search field:

and click on the Webhooks service. If you haven’t connected to the Webhooks service, then you’ll be asked to connect first:

In any case, you’ll then see a list of triggers (only one trigger — the “receive web request” trigger is currently available):

Select the “receive a web request” trigger:

Choose a name for the event. This will be tied to the Reward in the quiznoob server. If you have multiple children, then their username will be used to prefix the event. For example, if their username is “suzi”, then try “suzi_time_15plus” as the event name:

Click the “Create trigger” button and you’ll be back at the “If THIS then THAT” screen:

Click on the “+THAT” button to add the corresponding action:

and type “Circle” to find the service:

Click on the “Circle” service. Again, you may be asked to connect to the Circle service:

After you connect to your Circle service, you’ll see a list of actions:

and select the “Extend Time Limit” action:

Select the Time Limit pull down to choose the child in your Circle system. I recommend that you also allow multiple extensions per day. Click the “Create action” button to finish the applet:

After you click “Finish”, your applet will be added to your collection of applets:

Finally, you’ll need to get the URL of the webhook listener and configure an environment variable for your quiznoob server. Back on the IFTTT, click “Search” at the top of the page and find the webhooks service:

Click the “Settings” on the right hand side:

Select the key show above (e.g., bKf8cVTF5VMgHc_u1-Heyg in this example). By the way, a new key will be generated if you click the “Edit Connection” button and invalidate any previous key. BE CAREFUL! In your command line, stop the Rails server, set the IFTTT_KEY variable and restart the Rails server:

...
Completed 200 OK in 192ms (Views: 0.8ms | ActiveRecord: 134.2ms)
^C
% export IFTTT_KEY=bKf8cVTF5VMgHc_u1-Heyg
% bundle exec rails s

That’s it! Now, you need to add the event as a Reward in the quiznoob server dashboard. On your quiznoob server, click on the Rewards tab:

Click on the “New Reward” button and enter the following parameters:

I usually select 15 hearts for 15 minutes, but I lowered the required hearts to 10 for this example. The “event” field is the suffix of any trigger event name you create in IFTTT. The user’s name is prefixed on to this event name and sent as an event to the IFTTT webhook listener. This much match EXACTLY and can be tested (follow the link on the Webhooks settings page in IFTTT). Click the “Create Reward” button and return back to the Rewards list:

On the mobile app (e.g., in the Simulator), click on the ❤️ count in the upper right on the navigation bar and you’ll now see the Reward you added:

If you select the 15mins reward, you can expend 10 of your 11 hearts to buy 15 minutes of time:

Click the heart and confirm your purchase:

You can see that you were charged 10 hearts because the total is down to 1 heart. The middle tab on the mobile app (under the Rewards) shows a list of your redemptions for the day:

You can only take a quiz once a day. This avoids kids taking the easiest quiz over and over to accumulate points. Points persist from day-to-day for each user and can be banked up. My daughter tends to hoard her points but my son spends them as soon as he earns them. The last tab on the mobile app is a leaderboard if you have multiple users on your server.

Next up…

We’ll add more quiz content including maps!

--

--