auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// Click SEND TEST EVENT and then select the event above to inspect it
// The code on this page is fully editable and is run on our servers
console.log(`Let's see where the ISS is with Node ${process.version}`)
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// We can use any package from NPM -- just 'require' it
const axios = require("axios")
// And we can use ES8 async/await to pull the ISS's position from the open API
const result = await axios.get("http://api.open-notify.org/iss-now.json")
// Let's save the data on the ISS's position to $event so we can reference it in the next code cell
$event.iss_position = result.data.iss_position
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// Now let's generate a URL to visualize the ISS position in Google Maps
console.log(`View ISS Position on Google Maps at https://maps.google.com/?q=${$event.iss_position.latitude},${$event.iss_position.longitude}&ll=${$event.iss_position.latitude},${$event.iss_position.longitude}&z=3`)
// Next, try customizing the script and automating it to run on a schedule or based on a webhook/HTTP request for free