Отсканируй на iPhone, чтобы установить
Este Shortcut te permitirá consultar los tiempos de llegada del próximo tren a la parada "Estación de ferrocarril" del Metro de Granada (España).
This shortcut will allow you to check the arrival times of the next train at the "Estación de ferrocarril" stop of the Granada Metro (Spain).
Что нового
Версия 1.0
First release
Что делает
Действий: 25-
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
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#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%\">Estación de ferrocarril<\/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 Estación de ferrocarril")
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 Estación de ferrocarril")
show()
}
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Ещё от vissdc
Вам также может понравиться
Реклама