You can also do it like this without needing to use curl
or user scripts:
<%*
const weather = await requestUrl('https://wttr.in/Berlin?format=%25l:+%25c+%25t+feels+like+%25f%5CnSunrise:+%25S%5CnSunset:++%25s%5CnMoon:++++%25m')
tR += weather.text
%>
If you want it in a user script for whatever reason, just use requestUrl
instead of curl
:
async function wheathernow() {
const weather = await requestUrl('https://wttr.in/Berlin?format=%25l:+%25c+%25t+feels+like+%25f%5CnSunrise:+%25S%5CnSunset:++%25s%5CnMoon:++++%25m')
return weather.text
}
module.exports = wheathernow;