ShareShortcuts
Fork “Link Shortener”

Har du bygget noget nyt oven på denne genvej? Del den som en fork: den bliver din egen genvej, som du styrer, og begge sider linker til hinanden, så arandomguy24 får kredit.

  1. 1Hent genvejen og ret den i Genveje-appen. Giv den sit eget navn.
  2. 2Del den fra Genveje-appen og kopiér iCloud-linket.
  3. 3Kom tilbage hertil, indsæt linket og beskriv, hvad der er anderledes, fx “Tilføjet et trin, der bruger Apple Intelligence til at gøre teksten mere personlig.”
Downloads
41K
Gemt
1
Handlinger
59
Kategori
Produktivitet
Version
1.0
Sprog
EN

Forhåndsvisning

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/

Nyheder

Version 1.0

First release

Versionshistorik
1.0 12. jun. 2022

First release

Hvad den gør

59 handlinger
  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

Vis som kode
Beta

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 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()
	}
}
Å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

Mere fra arandomguy24

Se alle

Du vil måske også kunne lide

Se alle
Annonce