Automators 6: Automating iOS with Matthew Cassinelli

I just updated the links in the shownotes :wink:

2 Likes

In the show you mentioned wanting OAuth 2.0 support. This is currently already possible, it just requires you to have a server to redirect the OAuth requests to the Shortcuts app. You can do this with a pretty simple php file which you can add to your server:

redirect.php

<?php
$shortcut = $_REQUEST['shortcut'] ?: 'OAuth%202.0';
$code = $_REQUEST['code'];

header('Location: ' . 'shortcut://run-shortcut?name=' . $shortcut . '&input=text&text=' . $code);
die();
?>

I currently have a Shortcut that interacts with the Foursquare API and uses OAuth 2.0 to allow me to quickly checkin to my most frequented places on Swarm (completely in the background and with a preselected sticker), which I’ll share at some point, but it’s not quite ready yet.

2 Likes

I definitely want to learn more about this @marc. I’m generally non-technical so “just requires you to have a server” is easier said than done :slight_smile:

If you want to help me build a tutorial for people to try this themselves, that’d be amazing – would blast the doors open for so much more opportunity.

I’m extremely jealous of your Foursquare shortcuts!!

2 Likes

Here’s the new links again just in case!

Open Twitter Lists - Workflow
Open Twitter Lists - Siri Shortcuts

Yeah I made the mistake of changing “handle” to “Twitter Username” thinking it’d be more readable, but I forgot I mentioned it so explicitly on the show and also didn’t update the Key for the magic variable for the final URL.

1 Like

A post was split to a new topic: OAuth 2.0 in Shortcuts

Great episode, thanks, Matt!

I see the subtraction of 8 hours, then adding 1 hour? What is that about? Is the 8 to get your local offset from GMT?

He mentions in the episode the UTC offset and daylight saving. That should be what it is accounting for.

1 Like

If you check my video I have a shortcut to make this work for all time zones. :wink:

2 Likes

Perfect, thanks. I’m in the middle of the episode now. :slight_smile:

Matt,

You may want to remove (or just reset) your Dark Sky API.

The shortcut you shared on Automators; The Golden Hour – Siri Shortcut still contains the API text at the beginning… I can envision it being downloaded and used as is, surpassing the 1000 call limit before you know it.

Thanks for sharing such a great shortcut!

@matthewcassinelli you mentioned teaching yourself as a non-programmer. I’m in the same boat but obviously much further behind. Looking through Shortcuts I would like to learn more about Variables. Do you have any good resources that explain what they are and how to use them?

I have the Golden Hour and a number of other Shortcuts that run using GPS and work ok from the App, the widget and even Launch Center Pro. But when I add them to Siri and run by voice input they fail to access my location and all relevant data is missing from the response. What am I missing?

See this thread.

1 Like

Hi,
Thank you so much for the explanations about dictionaries!
I was stuck on a Shortcut to prefill name and email in an URL for a Typeform I am working on. Now I can preselect the recipient and he will get his form response via email automatically! :smiley:

1 Like

Here’s one article,

Basics of Computer Programming 101 - Variables and Data Types

It also appears that the list name is case sensitive. I had to make I put them in my list as lowercase for it to work in the Twitter app.

Just listened to the show today, coincidentally also discovered I can put Google assistant on my iPhone. I’m an android user at heart but work assigns me iOS devices…
So I experimented with shortcuts and now can hail Siri, ask her to put me through to google, and speak to my usual google assistant! Thanks for the inspiration!
https://drive.google.com/open?id=1TJ4KEWf1dO2zsgF-JwTG3KWvr__vetfh

Hi Matthew, great podcast. I am trying to text the result of a “show alert screen but it only comes out with a .txt file attached to the message. What am I missing. Thanks Wayne

If you can provide a screenshot or a copy of the shortcut, that helps explain things in context. But here’s some pointers that’ll hopefully explain your particular scenario:

  • Show Alert passes any input it receives as output, it does not generate any of it’s own. Therefore you can’t include it in your message as it isn’t anything in that sense. It shows info to the user and optionally the choice to cancel continuation of the shortcut.
  • Send Message takes any input it receives and will attempt to attach it as a file - e.g. a text file.
  • To attach nothing to a Send Message, use a Nothing action immediately prior to it.
  • If you have an action with output, followed by a Show Alert, followed by a Send Message, Send Message will attempt to attach the output of the action before the Show Alert.
  • To include specific content defined or generated earlier in the shortcut in the Send Message text, use a variable (/magic variable) in the Send Message action’s Message field to reference that content explicitly.

Hope that helps.

Hi All, to explain further I am trying to make a booking app for our Uber type service and I have 2 issues not yet resolved. 1. Find the distance between 2 locations not currently where you are. Maps shortcuts don’t seem to allow you to do this.
2. The result of the booking information “show alert” needs to be able to be messaged to a mobile or email.
I have been working through David’s Siri shortcuts training so have been practising with set and get variables which I will swap out later with magic variables. Here is my shortcut so far.
https://www.icloud.com/shortcuts/f6c5344459544e41a897378b330e9018
Thanks for your help