Sends a page to a self-hosted Readeck instance and offers option to read article immediately or download an ePub copy.
What's New
Version 1.0
First release
What it does
31 actions-
CommentSet your base url below - e.g https://readeck.example.com (no forward slash)
-
Text
-
CommentSet your API key
-
Text
-
URL…/api/bookmarks
-
Get Contents of URL…
-
Get Dictionary from Input
-
Get Dictionary Value
-
Set VariableStatus
-
If
-
Choose from Menu🙌 Article saved!
-
Choose from Menu⬇️ Download ePub
-
Get Contents of URL…
-
Get Item from List
-
Get Dictionary Value
-
URL…/…/article.epub
-
Wait
-
Get Contents of URL…
-
Open File
-
Stop This Shortcut
-
Choose from Menu📖 Read now
-
Get Contents of URL…
-
Get Item from List
-
Get Dictionary Value
-
URL…/bookmarks/…
-
Wait
-
Open URLs
-
Stop This Shortcut
-
If
-
Show Alert
-
Stop This Shortcut
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/web'
#define color blue
#define glyph bookmark
// Set your base url below - e.g https://readeck.example.com (no forward slash)
// Set your API key
url("{}/api/bookmarks")
const ContentsOfURL = jsonRequest(, "POST", {
"url": "{ShortcutInput}"
}, {
"Authorization": "Bearer {}",
"accept": "application/json",
"content-type": "application/json"
})
const Dictionary = getDictionary(ContentsOfURL)
@Status = Dictionary['status']
if @Status == 202 {
menu "🙌 Article saved!" {
item "⬇️ Download ePub":
const ContentsOfURL1 = jsonRequest(, "GET", {
"url": "{ShortcutInput}"
}, {
"Authorization": "Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5cHR0NkZodVRmV1FhRTk4YnFwSkhHIn0.qO2VRjrw3FeWold7XRIzQOs_l4eoUnOgpUS6Rx7KSGANd9c6qmHdbCXQ8rTAJb790SavjYMJlxa0LF5EF40nAQ",
"accept": "application/json",
"content-type": "application/json"
})
const ItemFromList = getListItem(ContentsOfURL1, 0)
url("{}/{}/article.epub")
wait(3)
const ContentsOfURL2 = jsonRequest(, "GET", {
"url": "{ShortcutInput}"
}, {
"Authorization": "Bearer {}",
"accept": "application/epub+zip"
})
openFile(ContentsOfURL2, false)
stop()
item "📖 Read now":
const ContentsOfURL3 = jsonRequest(, "GET", {
"url": "{ShortcutInput}"
}, {
"Authorization": "Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5cHR0NkZodVRmV1FhRTk4YnFwSkhHIn0.qO2VRjrw3FeWold7XRIzQOs_l4eoUnOgpUS6Rx7KSGANd9c6qmHdbCXQ8rTAJb790SavjYMJlxa0LF5EF40nAQ",
"accept": "application/json",
"content-type": "application/json"
})
const ItemFromList1 = getListItem(ContentsOfURL3, 0)
const URL = url("{}/bookmarks/{}")
wait(3)
openURL(URL)
stop()
}
} else {
confirm("Something went wrong.")
stop()
}
}
Open in Cherri Playground
Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.
Ratings & Reviews
Write a Review–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Advertisement
You Might Also Like
Advertisement