Sends a page to a self-hosted Readeck instance and offers option to read article immediately or download an ePub copy.
Nyheder
Version 1.0
First release
Hvad den gør
31 handlinger-
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
Vis som kode
Alle genvejens handlinger skrevet ud i Cherri, et programmeringssprog til genveje. Perfekt til at lære, hvordan den virker.
#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()
}
}
Åbn i Cherri Playground
Dekompileret med cherri 2.3.0 (GPL-2.0). Kan kræve små rettelser, før den kan kompileres.
Bedømmelser og anmeldelser
Skriv en anmeldelse–
ud af 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Ingen anmeldelser endnu. Vær den første!
Annonce
Du vil måske også kunne lide
Annonce