Chciałbym zbierać dane pogodowe z openweathermap.org
API wyrzuca JSON np takie:
Kod: Zaznacz cały
"main":{
"temp":306.15, //current temperature
"pressure":1013,
"humidity":44,
"temp_min":306, //min current temperature in the city
"temp_max":306 //max current temperature in the city
}
Kod: Zaznacz cały
{% set temperature = getUrl('https://api.openweathermap.org/data/2.5/weather?lat=xxxx&lon=xx&appid=xxxxxxxxxxxxxxxxxxxxxxxxx', '#"temp":([+-]?[0-9]*[.]?[0-9]+)#s')|number_format%}
{ temperature > 10000 }
Gdzie jest błąd?Warunek jest aktualnie spełniony.