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
What it does
25 actions-
CommentMetro 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/
-
URLhttps://metropolitanogranada.es/horariosreal
-
Get Contents of URLhttps://metropolitanogranada.es/MGhorariosreal.asp
-
Make HTML from Rich Text
-
Match Text
-
Get Group from Matched Text
-
Get Item from List
-
Set Variablet1
-
Get Item from List
-
Set Variablet2
-
Get Item from List
-
Set Variablet3
-
Get Item from List
-
Set Variablet4
-
Match Text
-
Get Group from Matched Text
-
Choose from Menu¿Vas en dirección Albolote o en dirección Armilla?
-
Choose from MenuHacia Albolote
-
Text
-
Set Name
-
Show Result
-
Choose from MenuHacia Armilla
-
Text
-
Set Name
-
Show Result
View as code
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
You Might Also Like
Advertisement