ShareShortcuts

Parada Recogidas

vissdc
Fork “Parada Recogidas”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so vissdc gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
19K
Saved
0
Actions
25
Category
Travel and Maps
Version
1.0
Language
ES

Este Shortcut te permitirá consultar los tiempos de llegada del próximo tren a la parada "Recogidas" del Metro de Granada (España).

This shortcut will allow you to check the arrival times of the next train at the "Recogidas" stop of the Granada Metro (Spain).

What's New

Version 1.0

First release

Version History
1.0 Nov 22, 2024

First release

What it does

25 actions
  1. Comment
    Metro de Granada © 2024 by Víctor Manuel Delgado Cabrerizo is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
  2. URL
    https://metropolitanogranada.es/horariosreal
  3. Get Contents of URL
    https://metropolitanogranada.es/MGhorariosreal.asp
  4. Make HTML from Rich Text
  5. Match Text
  6. Get Group from Matched Text
  7. Get Item from List
  8. Set Variable
    t1
  9. Get Item from List
  10. Set Variable
    t2
  11. Get Item from List
  12. Set Variable
    t3
  13. Get Item from List
  14. Set Variable
    t4
  15. Match Text
  16. Get Group from Matched Text
  17. Choose from Menu
    ¿Vas en dirección Albolote o en dirección Armilla?
  18. Choose from Menu
    Hacia Albolote
  19. Text
  20. Set Name
  21. Show Result
  22. Choose from Menu
    Hacia Armilla
  23. Text
  24. Set Name
  25. Show Result

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/web'
#define color red
#define glyph tramTunnel

//  Metro de Granada © 2024 by Víctor Manuel Delgado Cabrerizo is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/

url("https://metropolitanogranada.es/horariosreal")
const MGhorariosRealHTML = fileRequest("https://metropolitanogranada.es/MGhorariosreal.asp", "POST", ShortcutInput, {
	"Accept": "*/*",
	"Accept-Encoding": "gzip, deflate, br, zstd",
	"Accept-Language": "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
	"Connection": "keep-alive",
	"Content-Length": "0",
	"Content-type": "application/x-www-form-urlencoded",
	"Cookie": "ASPSESSIONIDSQARBQTR=PJOAGJDCKLBMPKDHCIKDLFPD",
	"DNT": "1",
	"Host": "metropolitanogranada.es",
	"Origin": "https://metropolitanogranada.es",
	"Referer": "https://metropolitanogranada.es/horariosreal",
	"Sec-Fetch-Dest": "empty",
	"Sec-Fetch-Mode": "cors",
	"Sec-Fetch-Site": "same-origin",
	"TE": "trailers",
	"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15"
})
const GruposTiemposParada = makeHTML(MGhorariosRealHTML, true)
const tiemposAlbolote = containsText(GruposTiemposParada, "<tr>[\s\S]*?<td width=\"40%\">Recogidas<\/td>[\s\S]*?<td width=\"15%\" class=\"HRdato limite\" style=\"text-align:center\">(.*?)<\/td>[\s\S]*?<td width=\"15%\" class=\"HRdato\" style=\"text-align:center\">([\s\S]*?)<\/td>[\s\S]*?<td width=\"15%\" class=\"HRdato limite\" style=\"text-align:center\">(.*?)<\/td>[\s\S]*?<td width=\"15%\" class=\"HRdato\" style=\"text-align:center\">([\s\S]*?)<\/td>[\s\S]*?<\/tr>")
const Texto = getMatchGroup(tiemposAlbolote, 0)
getListItem(Texto, 1)
@t1
getListItem(Texto, 2)
@t2
getListItem(Texto, 3)
@t3
getListItem(Texto, 4)
@t4
const retrievingTime = containsText(GruposTiemposParada, "<div style=\"text-align:right;width:100%\">(.*?)<\/div><div class=\"row\">")
getMatchGroup(retrievingTime, 0)

menu "¿Vas en dirección Albolote o en dirección Armilla?" {
item "Hacia Albolote":
	const Texto1 = "El primer tren llegará a la parada en {@t1}; el segundo lo hará en {@t2}\n---\nDatos recuperados de {} el {}"
	setName(Texto1, "Parada Recogidas")
	show()
item "Hacia Armilla":
	const Texto2 = "El primer tren llegará a la parada en {@t3}; el segundo lo hará en {@t4}\n---\nDatos recuperados de {} el {}"
	setName(Texto2, "Parada Recogidas")
	show()
}
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

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

Advertisement

More by vissdc

See All

You Might Also Like

See All
Advertisement