Earthquakes and Nightbot

How do I get Nightbot to post Earthquakes from Usgs?

1 Like

Hey @grashoppa!

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}`)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.