Отсканируй на iPhone, чтобы установить
Sends a page to a self-hosted Readeck instance and offers option to read article immediately or download an ePub copy.
Что нового
Версия 1.0
First release
Что делает
Действий: 31-
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
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#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 = getRandomItem(ContentsOfURL3)
const URL = url("{}/bookmarks/{}")
wait(3)
openURL(URL)
stop()
}
} else {
confirm("Something went wrong.")
stop()
}
}
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Вам также может понравиться
Реклама