Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1538

Help: Rainmeter Skins • Re: Parsing Weather from wttr.in

$
0
0
Along the same line as jsmorley's advice...

According to their docs:
To have the new line in the output when the %-notation is used, use '\n' and single quotes when doing a query from the shell.
so, I did just that, though skipping single quotes (not sure why they'd be required, but if in doubt, better use them as the docs mention):
https://wttr.in/New%20York?format=%c\n%l\n%t\n%w\n%S\n%s\n%m\n%M\n%p\n%P\n%h\n%C&lang=en
which returned:
Wttr.jpg
easily parsed via something like (the ^ and $ anchors for the start and end of the string are optional, \R is either \r\n or \n aka a newline):

Code:

^(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)\R(.*)$
The double space or double quote variant is just as good, though I feel using newlines makes the separation more obvious, both in code and when looking at the page source.

Statistics: Posted by Yincognito — Today, 7:40 pm



Viewing all articles
Browse latest Browse all 1538

Trending Articles