COMMENT
Precios de combustibles a partir de datos públicos disponibles en geoportalgasolineras.es — @atnbueno (2022-04-14)
TEXT
{
"ARABA\/ÁLAVA": "01",
"ARABA": "01",
"ÁLAVA": "01",
"ALBACETE": "02",
"ALICANTE": "03",
"ALMERÍA": "04",
"ÁVILA": "05",
"BADAJOZ": "06",
"BALEARS (ILLES)": "07",
"ILLES BALEARS": "07",
"BALEARS": "07",
"BARCELONA": "08",
"BIZKAIA": "48",
"BURGOS": "09",
"CÁCERES": "10",
"CÁDIZ": "11",
"CANTABRIA": "39",
"CASTELLÓN \/ CASTELLÓ": "12",
"CASTELLÓN": "12",
"CASTELLÓ": "12",
"CEUTA": "51",
"CIUDAD REAL": "13",
"CÓRDOBA": "14",
"CORUÑA (A)": "15",
"A CORUÑA": "15",
"CUENCA": "16",
"GIPUZKOA": "20",
"GIRONA": "17",
"GERONA": "17",
"GRANADA": "18",
"GUADALAJARA": "19",
"HUELVA": "21",
"HUESCA": "22",
"JAÉN": "23",
"LEÓN": "24",
"LLEIDA": "25",
"LUGO": "27",
"MADRID": "28",
"MÁLAGA": "29",
"MELILLA": "52",
"MURCIA": "30",
"NAVARRA": "31",
"OURENSE": "32",
"ASTURIAS": "33",
"PALENCIA": "34",
"PALMAS (LAS)": "35",
"LAS PALMAS": "35",
"PONTEVEDRA": "36",
"RIOJA (LA)": "26",
"LA RIOJA": "26",
"SALAMANCA": "37",
"SANTA CRUZ DE TENERIFE": "38",
"SEGOVIA": "40",
"SEVILLA": "41",
"SORIA": "42",
"TARRAGONA": "43",
"TERUEL": "44",
"TOLEDO": "45",
"VALENCIA \/ VALÈNCIA": "46",
"VALENCIA": "46",
"VALÈNCIA": "46",
"VALLADOLID": "47",
"ZAMORA": "49",
"ZARAGOZA": "50"
}

Text
SCRIPTING
Get dictionary from
Texto

Dictionary
VARIABLES
Set variable
varProv
to
Diccionario
LOCATION
Get current location

Current Location
VARIABLES
Set variable
Ubicación
to
Ubicación actual
LOCATION
Get
State
from
Ubicación

State
TEXT
Change
Provincia
to
UPPERCASE

Updated Text
SCRIPTING
Get
Value
for
PROVINCIA
in
varProv

Dictionary Value
LOCATION
Get
City
from
Ubicación

City
NETWORK
Get contents of
https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/Listados/Provincias/
Options Under Construction

Contents of URL
NETWORK
Get contents of
https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/Listados/MunicipiosPorProvincia/
IdProvincia
Options Under Construction

Contents of URL
TEXT
Match
.+
Ciudad
.+
in
Datos de municipios

Matches
SCRIPTING
Get dictionary from
Datos municipio

Dictionary
SCRIPTING
If
Datos municipio
does not have any value
SCRIPTING
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
NETWORK
Get contents of
https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/FiltroMunicipio/
IDMunicipio
Options Under Construction

Contents of URL
SCRIPTING
Get dictionary from
EESS por municipio

Dictionary
SCRIPTING
Get
Value
for
ResultadoConsulta
in
EESS por municipio

Dictionary Value
SCRIPTING
If
Resultado consulta
is not
OK
SCRIPTING
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
Get
Value
for
ListaEESSPrecio
in
EESS por municipio

Dictionary Value
LOCATION
Get
Latitude
from
Ubicación

Latitude
LOCATION
Get
Longitude
from
Ubicación

Longitude
DICTIONARY

Dictionary
VARIABLES
Set variable
EESS
to
Diccionario
SCRIPTING
Repeat with each item in
ListaEESSPrecio

Repeat Results
DOCUMENTS
Replace
,
with
.
in
sqrt((
Latitud
-
Repeat Item
)**2+(
Repeat Item
-
Longitud
)**2)

Updated Text
MISSING
calculateexpression Under Construction
SCRIPTING
Set
distancia
to
Distancia en grados
in
Dictionary

Dictionary
SCRIPTING
Set
IDEESS
to
Diccionario
in
Dictionary

Dictionary
VARIABLES
Set variable
EESS
to
Diccionario
TEXT
Match
\d+,\d{6}
in
Distancia en grados

Matches
TEXT
Repeat Item
;
Coincidencias

Text
SCRIPTING
End Repeat

Repeat Results
FILES
Filter
Resultado de la repetición

Files
TEXT
Match
(?<=;)\d+
in
Archivos

Matches
SCRIPTING
Repeat with each item in
Coincidencias

Repeat Results
SCRIPTING
Get
Value
for
Repeat Item
in
EESS

Dictionary Value
TEXT
Match
(?<=Precio )[^"]+":"[^"]+
in
Valor del diccionario

Matches
DOCUMENTS
Replace
":"
with
</td><td>
in
Coincidencias

Updated Text
TEXT
Combine
Texto actualizado
with
Custom
</td></tr><tr><td>

Combined Text
SCRIPTING
Get dictionary from
Valor del diccionario

Dictionary
DOCUMENTS
Replace
,
with
.
in
Longitud (WGS84)
%2C
Latitud

Updated Text
TEXT
<tr>
<td>
distancia
</td>
<td><a href="https://maps.apple.com/?q=
Dirección
">
Rótulo
<br>
Texto combinado
,
C.P.
Municipio
</a></td>
<td>
LatLon
<br>
Horario
</td>
<td><table><tr><td>
Provincia
</td><tr></table></td>
</tr>

Text
SCRIPTING
End Repeat

Repeat Results
TEXT
Combine
Resultado de la repetición
with
New Lines

Combined Text
TEXT
<meta charset="UTF-8">
<table border>
<tr><th>Distancia (º)</th><th>Dirección</th><th>Detalles</th><th>Precios</th></tr>
Texto combinado
</table>

Text
SCRIPTING
Set name of
Texto
to
Precios combustible.html

Renamed Item
DOCUMENTS
Show
Ítem renombrado
in Quick Look