Weather just humidity and temp

Asked Jun 18, 2022·5 replies·Last activity 4 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

is there a way to make the $(weather) only output the temperature and humidity parts? im using a command from another topic that had shortened it to just the temperature but dont quite understand how they did it.

!addcom -cd=5 !temp $(eval d=decodeURIComponent($(querystring));a=d==`?$(weather LOCATION):$(weather $(query));e=d==?LOCATION:d;b=a.split(.)[0].split( );c=[];for(i=0;i<b.length;i++){if(/\d/.test(b[i])){c.push(b[i]);}}The temperature in +e+ is +c.join( `))

5 replies

!addcom -cd=5 !temp $(eval d=decodeURIComponent(`$(querystring)`);a=d==``?`$(weather LOCATION)`:`$(weather $(query))`;e=d==``?`LOCATION`:d;b=a.split(`.`)[0].split(` `);c=[];for(i=0;i<b.length;i++){if(/\d/.test(b[i])){c.push(b[i]);}}`The temperature in `+e+` is `+c.join(` `))

Hey @Glad Parrot!

Here's the topic you're referring to, in case people in the future want to read it:
(link expired)

Their command can't easily be made into what you want tho'.

So here's what I'm suggesting instead:

$(eval a='$(weather $(query))'; o=a.match(/weather(\s\S+){2}/i); o.length=1; o.push(a.match(/temperature(\s\S+){3}/i)[0].replace('.', ' and')); o.push(a.match(/humidity(\s\S+){2}/i)[0]); o.join(' ');)

thank you, but it still says the location in the output, which i didnt want :( sorry im looking for something so specific

You should have specified, because the command you showed as example included the location.
You simply need to remove the first match:

$(eval a='$(weather $(query))'; `${a.match(/temperature(\s\S+){3}/i)[0].replace('.', ' and')} ${a.match(/humidity(\s\S+){2}/i)[0]}`)
Polar Cat said:
```
$(eval a='$(weather $(query))'; ${a.match(/temperature(\s\S+){3}/i)[0].replace('.', ' and')} ${a.match(/humidity(\s\S+){2}/i)[0]})
```

thank you so much for the help

Didn't find your answer? The community is on Discord.

Ask on Discord