Отсканируй на iPhone, чтобы установить
Просмотр
A link shortener You can also use with iOS or iPadOS 14 Credits: I used [Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ] for the update system Also on Routinehub.co https://routinehub.co/shortcut/12150/
Что нового
Версия 1.0
First release
Что делает
Действий: 59-
CommentMade by @ArandomGuy24 for RoutineHub and ShareShortcuts.com https://www.routinehub.co/user/ArandomGuy24 https://shareshortcuts.com/u/arandomguy24/ Also I used [Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ] for the update system https://routinehub.co/shortcut/2672/
-
CommentUsing RoutineHub UpdateKit api
-
Get URLs from Input
-
Set Variableinput
-
Repeat
-
Dictionary
-
Set VariableLocalData
-
Get IP Address
-
Count
-
If
-
Show Alert
-
If
-
URLhttps://routinehub.co/api/v1/shortcuts/…/versions/latest
-
Get Contents of URL…
-
If
-
Dictionary
-
Text
-
URLdata:text/html,…
-
Get Contents of Web Page
-
If
-
If
-
If
-
Text
-
If
-
Text
-
Choose from Menu… … Update checking with [Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ]
-
Choose from MenuInstall result (Version)
-
URLhttps://routinehub.co/download/…
-
Open URLs
-
Stop and Output
-
Choose from MenuLater
-
If
-
Show Alert
-
If
-
Ask for InputWhat link do you want to shorten?
-
Set Variableinput
-
URLhttps://shorter.tins.ml/api/new?url=…
-
Get Contents of URL…
-
Get Dictionary Value
-
Set Variablelink
-
If
-
Get Contents of URL…
-
Get Dictionary Value
-
Set Variablestatus
-
Show Alert
-
If
-
Choose from MenuSuccess …
-
Choose from MenuSave to clipboard
-
Copy to Clipboard
-
Show Alert
-
Choose from Menu
-
Choose from MenuShorten more
-
Run ShortcutLink Shortener
-
Choose from MenuExit
-
Stop This Shortcut
-
Choose from MenuShorten more links
-
Run ShortcutLink Shortener
-
Choose from MenuExit
-
Stop This Shortcut
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#include 'actions/web'
#define color blue
#define glyph chainlink
/*
Made by @ArandomGuy24 for RoutineHub and ShareShortcuts.com
https://www.routinehub.co/user/ArandomGuy24
https://shareshortcuts.com/u/arandomguy24/
Also I used [Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ] for the update system
https://routinehub.co/shortcut/2672/
*/
// Using RoutineHub UpdateKit api
getURLs(ShortcutInput)
@input
repeat _ for nil {
@LocalData = {
"RoutineHub ID": "12150",
"Version": "0.06"
}
const CurrentIPAddress = getExternalIP()
const Count = count(CurrentIPAddress)
if Count == 0 {
confirm("[Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ] Could not check for updates, there is no internet connection.")
} else {
url("https://routinehub.co/api/v1/shortcuts/{@LocalData['ID']}/versions/latest")
const result = downloadURL()
if result contains "success" {
const CompareVersionsData = {
"current": "{@LocalData['Version']}",
"new": "{result['Version']}"
}
const CompareVersionsHTML = "<html><head></head><body><script>\n// Embed-a-Engine 1.0\nfunction cmp (a, b) {\nlet pa = a.split('.');\nlet pb = b.split('.');\nfor (let i = 0; i < Math.max(pa.length, pb.length); i++) {\nlet na = Number(pa[i]);\nlet nb = Number(pb[i]);\nif (isNaN(na)) na = 0;\nif (isNaN(nb)) nb = 0;\nif (na > nb) return \\"RollbackAvailable\\";\nif (nb > na) return \\"UpdateAvailable\\";\n}\nreturn \\"NoChanges\\";\n};\nlet data = {CompareVersionsData};\ndocument.write(cmp(data.current, data.new));\n</script></body></html>"
url("data:text/html,{CompareVersionsHTML}")
const ContentsOfWebPage = getWebpageContents()
if ContentsOfWebPage == "NoChanges" {
} else {
if ContentsOfWebPage == "RollbackAvailable" {
} else {
}
menu "{}\n\n{result['Notes']}\n\nUpdate checking with [Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ]" {
item "Install {result['Version']}":
const URL = url("https://routinehub.co/download/{result['id']}")
openURL(URL)
output(URL)
item :
}
}
} else {
alert("Could not check for updates because of a RoutineHub error:\n\n{result['message']}", "")
}
}
}
if !@input {
prompt("What link do you want to shorten?", "URL")
@input
}
url("https://shorter.tins.ml/api/new?url={@input}")
const ContentsOfURL = downloadURL()
@link = ContentsOfURL['short_url']
if !@link {
const ContentsOfURL1 = downloadURL(@link)
@status = ContentsOfURL1['message']
confirm(@status)
} else {
menu "Success {@link}" {
item "Save to clipboard":
setClipboard(@link)
confirm("Saved")
menu nil {
item "Shorten more":
runSelf()
item "Exit":
stop()
}
item "Shorten more links":
runSelf()
item "Exit":
stop()
}
}
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Ещё от arandomguy24
Вам также может понравиться
Реклама