Scanne avec ton iPhone pour installer
Este Shortcut te permitirá consultar los tiempos de llegada del próximo tren a la parada "Andrés Segovia" del Metro de Granada (España).
This shortcut will allow you to check the arrival times of the next train at the "Andrés Segovia" stop of the Granada Metro (Spain).
Nouveautés
Version 1.0
First release
Ce qu’il fait
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
Afficher en tant que code
Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.
#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%\">Andrés Segovia<\/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 Andrés Segovia")
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 Andrés Segovia")
show()
}
Ouvrir dans Cherri Playground
Décompilé avec cherri 2.3.0 (GPL-2.0). Quelques corrections peuvent être nécessaires avant la compilation.
Notes et avis
Écrire un avis–
sur 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Aucun avis pour le moment. Sois le premier à partager ton avis !
Publicité
Plus de vissdc
Ça pourrait aussi te plaire
Publicité