Nightbot command for Steam stats?

Asked Apr 10, 2020·1 reply·Last activity 6 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.

Hey all, I was hoping someone could help me create a command that would fetch the statistic line from the Steamcharts website. I nearly have it with a simple fetch but because the fetch is limited It gives an error. I don't know how to use the URL fetch with Json and could really use some help. I appreciate anything you can do to help me 😃

smiley.png

1 reply

Urlfetch by default grabs up to 400 characters while its json variant can grab more. If you're handy with eval you could use urlfetch json along with some code to refine Nightbot's output, otherwise just display the first 400 characters of the fetch like so.

$(eval decodeURIComponent(`$(querystring $(urlfetch json URL))`).slice(0,400))