Earthquakes and Nightbot

Asked Feb 20, 2022·1 reply·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.

How do I get Nightbot to post Earthquakes from Usgs?

1 reply

Hey @Bubbly Hedgehog!

By using their API, the following command will give you the latest earthquake:

!addcom !earthquake $(eval f=$(urlfetch json https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson).features; l=f[0].properties; `Latest earthquake: ${l.title} ${l.url}`)