Quotes

Learn how to use Shortcuts to periodically query an external API and pass multiple inputs to a Pushcut Widget.

Step 1: Create the Quote of the Day Widget and its Content

Create your Quote Content by importing the provided JSON. Learn more about how to do this on our support page.

Then, create a new Quote Widget and set its default content to your new Quote Content.

Step 2: Create a shortcut to update your widget

Using the Shortcuts app, create a widget with the steps outlined on this screenshot. You can also directly import this shortcut on your device using this link.

We use the Get Contents of URL built-in Shortcut action to make a GET request to the They Said So Quotes API and proceed to parse the returned JSON object using the Get Dictionary From Input and Get Item from List actions.

Since we'd like our Widget to display both the quote and its author, we must pass two inputs to it. In order to do so, we use the List action to organize them into a single object that we'll later pass as the input of the Update Widget action.

You can tap on the play button on the bottom-right corner of your screen to test and see if everything is working! Keep in mind that, because of how iOS controls widget updates, it may take a while (up to 15 minutes) before the widget is actually updated.

Step 3: Setup your daily automation

To avoid having to create many repeated automations to update your widgets, let's organize all shortcuts that should run daily on a "parent shortcut" that will execute all its children.

Create a new Daily Pushcut Widgets shortcut, choose the Run Shortcut action and choose the Update Quote Widget shortcut you just created.

Step 4: Set up the automation and that's it!

If you haven't done it yet, using the Shortcuts App create a new Automation that will execute your Daily Pushcut Widgets shortcut everyday. As always, make sure the Ask Before Running is disabled if you'd like to avoid receiving a notification everytime your automation is executed. If you need more details on how to do this, check out our Milestone Widget Guide.

And that's a wrap! You can use what you've learned with this guide to connect your widgets to any other services that provide an accessible API or you can go a step further and use one of the supported [integration services/support/integrations) to update your widget anytime a compatible services generates new information.

Widget JSON

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
  "type": "column",
  "properties": {
    "background": {
      "type": "gradient",
      "value": {
        "colors": [
          "rgba(76.86%, 76.86%, 76.86%, 1.00)",
          "rgba(50.59%, 50.59%, 50.59%, 1.00)"
        ],
        "startPoint": {
          "x": 0.19047611781529017,
          "y": 0
        },
        "type": "linear",
        "endPoint": {
          "x": 0.08095234462193082,
          "y": 1
        }
      }
    },
    "padding": {
      "trailing": 20,
      "top": 20,
      "leading": 20,
      "bottom": 20
    },
    "font": {
      "family": "Georgia"
    },
    "spacing": 15
  },
  "children": [
    {
      "type": "column",
      "properties": {
        "fillDirection": "width",
        "horizontalAlignment": "leading"
      },
      "children": [
        {
          "type": "row",
          "properties": {
            "foregroundColor": "rgba(21.63%, 16.26%, 11.51%, 0.60)",
            "font": {
              "size": 21,
              "weight": "bold"
            },
            "fillDirection": "none",
            "spacing": 5
          },
          "children": [
            {
              "type": "symbol",
              "value": "quote.opening"
            },
            {
              "type": "text",
              "value": "_Quote of the day_"
            }
          ]
        },
        {
          "type": "spacer",
          "value": "horizontal"
        }
      ]
    },
    {
      "type": "column",
      "properties": {
        "horizontalAlignment": "leading"
      },
      "children": [
        {
          "type": "row",
          "properties": {
            "verticalAlignment": "top",
            "fillDirection": "none"
          },
          "children": [
            {
              "type": "text",
              "value": "_[[input0]]_",
              "properties": {
                "foregroundColor": "rgba(100.00%, 100.00%, 100.00%, 1.00)"
              }
            },
            {
              "type": "spacer",
              "value": "vertical"
            }
          ]
        },
        {
          "type": "spacer",
          "value": "horizontal"
        }
      ]
    },
    {
      "type": "column",
      "properties": {
        "fillDirection": "width",
        "horizontalAlignment": "trailing"
      },
      "children": [
        {
          "type": "spacer",
          "value": "horizontal"
        },
        {
          "type": "text",
          "value": "***[[input1]]***",
          "properties": {
            "foregroundColor": "rgba(21.63%, 16.26%, 11.51%, 0.60)"
          }
        }
      ]
    }
  ]
}
Check the Widget documentation for more details.