Integrations

Qbserve logs your productivity automatically and can trigger other applications and web services when you reach certain thresholds. For example, 3 hours of total productive time, or 1 hour of total distracting time, or 45 minutes of activities in the "Design" category.

To setup an integration, create an alert in Preferences -> Notifications and then select it to add events. Two types of events are available: webhooks and AppleScript, you can set both of them for a single alert.

AppleScript

AppleScript is the powerful automation built into macOS. It can be used to do anything inside the system: launch or quit other apps, create or move files, switch playlist in iTunes, send emails, add Calendar events. You can find many ready scripts for your needs on Doug's Scripts, MacScripter, and StackOverflow.

A good use case for AppleScript would be connecting Qbserve to the Focus app, so you can block distracting websites after reaching a daily distraction limit. This script activates Focus with its default hotkey "Command + Option + Control + F":

tell application "System Events"
    keystroke "f" using {command down, option down, control down}
end tell

Here are the steps to do it:

  • go to the Preferences -> Notifications in Qbserve
  • select an alert for distracting time in the table (or create a new one)
  • open the event editing window with the "Add Events" button
  • select the AppleScript section
  • copy the scripts's code into the text box
  • save the changes by pressing the "Update Events" button

AppleScript event

Now if Focus is running, it will block distracting sites on Qbserve alert. You may need to add some of the distracting domains to the Focus preferences since the apps have separate website lists.

Webhooks

Webhook is just a URL, usually obtained from some integration service like Zapier or IFTTT. On a Qbserve alert, a webhook event will call this URL once, sending from 0 to 3 parameters of your choice. Parameters are not required unless you want to pass some information in a key-value form. By default Qbserve suggests to send productivity or category and total minutes spent in it.

Webhook event

You have lots of possibilities for event results. For example: add a record to your team's time tracker, automate your status in Slack, log your daily goals to a Google spreadsheet, tweet something, save money, or change Philips Hue lights color.

Below you can see the steps for setting up a webhook on the mentioned services.

Zapier

Zapier is really easy to setup:

  • make a Zap
  • select "Webhooks" from the built-in apps list
  • select "Catch Hook" as a Trigger
  • skip the "Child Key" step
  • copy the webhook URL to the Event Editor in Qbserve

IFTTT

IFTTT setup is a bit more complicated but once you create the first webhook, all others will be easier:

  • go to https://ifttt.com/my_applets
  • create a new applet
  • click "this" and search for "Maker Webhooks"
  • name an event like "distracting_30min"
  • click "that" and add a service you want to be called
  • create an action and finish it
  • go to https://ifttt.com/services/maker_webhooks/settings
  • open the URL (it's not clickable for some reason)
  • follow the instructions on the page to make a webhook
  • copy the webhook URL to the Event Editor in Qbserve

In the end you should have a link in this format:
https://maker.ifttt.com/trigger/EVENT_NAME/with/key/SECRET_KEY

For example:
https://maker.ifttt.com/trigger/distracting_30min/with/key/abcdEFgHij-kL-mN-oPq

You can now create webhooks for other alerts and only replace the event name in the URL above.