Workflow question - Article vs. URL vs. Web Page?

Can anyone help explain or recommend info…

How is an Article defined in Workflow?
What does an Article vs. Web Page provide?
When should I use Article as opposed to URL or Web Page?
Llisting these actions out, I don’t understand their overlap or differences:

-URL
-Get URL from input
-Get Contents of URL
-Get Contents of Web Page
-Get Article from Web Page
-Get Details of Articles
-Get Details of Safari Web Page
-Open URLS (in Safari)*
-Open URLS in Chrome*
-Show Web Page (in Safari “view controller”?)

  • Why are the descriptions/input/output for Safari and Chrome so different?
1 Like

That’s quite a list of actions that are very different, but here’s my best shot of covering what you’re asking…

URL

A URL is a uniform resource locator … more commonly referred to as a web address. It is a string of characters that defines the name of a web page or other web hosted resource, but it in and of itself is not that resource or the content of that resource. When passed to a suitable client application (like a web browser), the application will be able to identify the server(s) to which it should request the resource, issue the request and receive he response. The type of request (we can fetch data, push payloads and sme other stuff) and the response received processing are dependent upon the purpose and functionality of the application.

URLs from Input

Getting a URL from input means simply pulling out any text strings that look like they meet the standardised format of a URL.

Content of URL

The content of the URL is what is returned by a hosting web server when you ask it for the resource specified by a URL. By default Shortcuts will provide the rendered (rich content rather than HTML for example) content rather than the raw content.

However there are more advanced options in this action that allow you to do things like push data up as well as pull it down (as per URL above) and this is the action that really opens up the interaction with hosted web services (e.g. Dark Sky has been popular on the forum recently) and allows you to communicate with and make use of their online APIs (Application Programming Interface).

Web page content

The content of a web page specifically grabs the content, pushes it into a web view controller, retrieves the rendered content directly. Where get contents will just get the contents of the specified resource file, get web page gets all of the associated resources too (e.g. the images on a web page).

Articles

Articles are as generated by Diffbot and the raison d’être of this service is to transform web pages into structured data. This means that the service looks for standardised constructions in the content of a page and allows those to be accessed in a way that is more conducive to programmatic operations or analysis. This allows you to do things like identify the core content of a post and strip out elements such as site navigation, advertisements, etc.

Safari Web Pages

Safari Web pages are the term Shortcuts uses for when it is dealing with pages rendered in the Safari web browser (look at the icon on the action). This is for use when sharing from Safari to Shortcuts. Safari allows some extra detail to be passed on the share sheet and Shortcuts is taking advantage of that.

Details of Safari Web Pages & Articles

Details of Safari pages and articles allow for the retrieval of specific attributes or subsets of data about a page or article. For example, the name (title) of a page or the author of an article.

Open URLs

Open URLs takes any URLs passed in and opens it in the respective browser. I believe the difference in the details of these, such that Safari seems able to handle so much more, is down to how iOS handles data, URLs and the fact that Safari is fundamentally the primary and default (no other choice) browser on iOS. For example, take a look at the option for Open URLs in Safari to be passed a telephone number. That’s nothing like a URL and has no way to extrapolate a URL from it through any associated data (like perhaps you would with a contact). Instead passing in a phone number will produce an iOS dialog asking you to confirm if you wish to dial the number. I have a feeling that the Shortcuts content graph engine is converting the phone number into a dial instruction for an iOS URL scheme (e.g. tel://0123456789) and then Safari is the place in iOS those URL schemes would be handled. Chrome is simply a second class citizen as it is not tightly coupled with the OS in the way Safari is.

Show Web Page

Finally, show web page is an action that will in effect give you an embedded browse within the app which you can interact with. On the vast majority of occasions that you are viewing a web page within an app, where you can interact with it, that’s using a Safari view controller. The key points are that it is interactive (you can browse around and are not constrained to just viewing a single static page) and you don’t leave the Shortcuts app (unlike the open URLs actions).

Hope that helps.

3 Likes

I have a question about the “Get Diffbot Article From Web Page” action in Shortcuts. According to Diffbot’s site, money has to change hands for scraping pages through them. Is this action a dead man walking? Is there a limit on how many times per day I can run it?

1 Like

The cost is for the API for the developer who uses their API key. So that would be Apple who I guess can afford this for now :wink:

You shouldn’t hit any daily limit.

1 Like