generated from extratone/latte
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApple News ⇨ Safari.jelly
43 lines (37 loc) · 1.64 KB
/
Apple News ⇨ Safari.jelly
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
import Shortcuts
#Color: red, #Icon: newsArticle
nothing()
/*
This shortcut is literally just a duplicate of Michael Bierman’s “Clean Apple News Links” shortcut: https://routinehub.co/shortcut/4234/
**NOTE: This Shortcut was created and published with explicit permission from the original Shortcut’s creator.**
I’ve just removed everything after the URL is returned and instead added the “Open URLs” action.
It works!
I’m @NeoYokel on Twitter and/or reachable at [email protected] if you need help or would like to point out something I could improve.
*/
/*
Version 1.1
To be honest, I had to duplicate Bierman’s shortcut again, though I believe I understood better what the shortcut was doing. All I know is that 1.0 was only returning the parent directory of a given cleaned Apple News link, but this one should return the right one without any remaining unnecessary stuff. :)
*/
getURLSFromInput(text: "${ShortcutInput}") >> getURLSFromInput
if(URLs != nil) {
var Input = URLs
} else {
text(text: "${Clipboard}") >> text
getURLSFromInput(text: "${Text}") >> getURLSFromInput 1
var Input = URLs
if(Input == nil) {
alert(alert: "No URL found", title: "Sorry")
exit()
} >> IFResult
} >> IFResult 1
getItemFromList(list: Input) >> getItemFromList
var URL = Item from List
if(Item from List .beginsWith "https://apple.news") {
// Deal with Apple News 🤦🏻♂️
downloadURL(url: "${URL}") >> downloadURL
getURLSFromInput(text: "${Contents of URL}") >> getURLSFromInput 2
getItemFromList(list: URLs) >> getItemFromList 1
var URL = Item from List
} >> IFResult 2
setClipboard(variable: URL) >> setClipboard
openURL(url: URL) >> openURL