In the spirit of the collaboration between NASA and SpaceX launching astronauts to the International Space Station, I’m digging up an old integration that I made for fun that utilized about a billion APIs so that any user in the sndevs slack channel could find out where exactly (with an included map) is the ISS at that moment.
What: A user would type
!iss into chat and my Slacker Bot would inform the chat the latitude, longitude, and city+country of where the ISS is, along with an google maps image to help visualize where.
How: Basically a million API calls and making a cohesive result out of all the integrations:
- !iss is invoked and an event is sent from Slack to ServiceNow via a scripted REST API
- ServiceNow makes a REST call to the ISS open-notify API to receive the latitude and longitude of the current location of the ISS
- ServiceNow makes another REST call to the Google Maps GeoCode API to find out the actual user-friendly city and country name for the coordinates received in step 2.
- ServiceNow makes another REST call to the Google Maps StaticMap API to get a small map image for the coordinates received in step 2.
- Finally, ServiceNow parses a message with all this information and makes a final REST call to Slack to post the message and image attachment.
All in all, it takes about 2 seconds from start to finish!
Also, calling it several times over the hour really shows how fast the ISS orbits our planet! The International Space Station orbits the Earth every 92 minutes at a speed of 4.76 miles per second.
In other news, I’m having a baby this week. I also hope to post a couple of articles on being an ally (one about being an ally to the black community and one about being an ally to women in dev and in general, #girldad).