ShareShortcuts
„Link Shortener“ forken

Hast du auf Basis dieses Kurzbefehls etwas Neues erstellt? Teile ihn als Fork: Er wird zu deinem eigenen Kurzbefehl, den du selbst verwaltest, und beide Seiten verlinken aufeinander, damit arandomguy24 die Anerkennung erhält.

  1. 1Lade den Kurzbefehl und ändere ihn in der Kurzbefehle-App. Gib ihm einen eigenen Namen.
  2. 2Teile ihn in der Kurzbefehle-App und kopiere den iCloud-Link.
  3. 3Komm hierher zurück, füge den Link ein und beschreibe, was sich geändert hat, z. B. „Einen Schritt hinzugefügt, der Apple Intelligence nutzt, um den Text zu personalisieren.“
Downloads
41K
Gesichert
1
Aktionen
59
Kategorie
Productivity
Version
1.0
Sprache
EN

Vorschau

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/

Neue Funktionen

Version 1.0

First release

Versionsverlauf
1.0 12. Jun 2022

First release

Was er macht

59 Aktionen
  1. Comment
    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/
  2. Comment
    Using RoutineHub UpdateKit api
  3. Get URLs from Input
  4. Set Variable
    input
  5. Repeat
  6. Dictionary
  7. Set Variable
    LocalData
  8. Get IP Address
  9. Count
  10. If
  11. Show Alert
  12. If
  13. URL
    https://routinehub.co/api/v1/shortcuts/…/versions/latest
  14. Get Contents of URL
    …
  15. If
  16. Dictionary
  17. Text
  18. URL
    data:text/html,…
  19. Get Contents of Web Page
  20. If
  21. If
  22. If
  23. Text
  24. If
  25. Text
  26. Choose from Menu
    … … Update checking with [Eᴍʙᴇᴅ-ᴀ-Uᴘᴅᴀᴛᴇ]
  27. Choose from Menu
    Install result (Version)
  28. URL
    https://routinehub.co/download/…
  29. Open URLs
  30. Stop and Output
  31. Choose from Menu
    Later
  32. If
  33. Show Alert
  34. If
  35. Ask for Input
    What link do you want to shorten?
  36. Set Variable
    input
  37. URL
    https://shorter.tins.ml/api/new?url=…
  38. Get Contents of URL
    …
  39. Get Dictionary Value
  40. Set Variable
    link
  41. If
  42. Get Contents of URL
    …
  43. Get Dictionary Value
  44. Set Variable
    status
  45. Show Alert
  46. If
  47. Choose from Menu
    Success …
  48. Choose from Menu
    Save to clipboard
  49. Copy to Clipboard
  50. Show Alert
  51. Choose from Menu
  52. Choose from Menu
    Shorten more
  53. Run Shortcut
    Link Shortener
  54. Choose from Menu
    Exit
  55. Stop This Shortcut
  56. Choose from Menu
    Shorten more links
  57. Run Shortcut
    Link Shortener
  58. Choose from Menu
    Exit
  59. Stop This Shortcut

Als Code ansehen
Beta

Jede Aktion dieses Kurzbefehls als Cherri ausgeschrieben, eine Programmiersprache für Kurzbefehle. Ideal, um zu lernen, wie er funktioniert.

#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()
	}
}
In Cherri Playground öffnen Mit cherri 2.3.0 (GPL-2.0) dekompiliert. Eventuell sind kleine Korrekturen nötig, bevor es kompiliert wird.

Bewertungen und Rezensionen

Rezension schreiben
–
von 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Werbung

Mehr von arandomguy24

Alle anzeigen

Das gefällt dir vielleicht auch

Alle anzeigen
Werbung