Show me the position of the International Space Station on Google Maps
@demo
code:
data:publiclast updated:4 years ago
today
Generate events to trigger workflow code...
This is a live workflow with public data.
Select an event to inspect the return values and logs for each step (learn more).
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
https://en3nw7js9dhm37a.m.pipedream.net
Trigger this workflow on each request
steps.
README
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
}
23
/*
This workflow returns a custom response to HTTP requests. 

When you load the endpoint, this workflow will:

1. Get the latest position of the International
Space Station (ISS) using the Open Notify API

2. Return an HTTP 302 redirect to Google Maps with a pin showing the latest position of the ISS

To try it out, just load the endpoint URL in your browser. For the public demo workflow, the URL is:

https://en3nw7js9dhm37a.m.pipedream.net

If you copy this workflow, the URL will change.

NOTE: The data for this workflow is public. Any data you send 
(including your IP address, user agent, etc) will be public.
To simply inspect executions, select events at the left. Or copy
and run a private copy of this workflow.
*/
steps.
get_iss_position
Make an HTTP or webhook request and return the response as a step export.
params
URL
http://api.open-notify.org/iss-now.json
string ·params.url
Method
string ·params.method
Optional
code
async params => {
1
2
3
4
5
6
7
8
9
10
11
}
12
const config = {
  method: params.method,
  url: params.url,
  params: params.query,
  headers: params.headers,
  responseType: params.responseType,
  data: params.data,
}
if (params.auth) config.auth = params.auth
return await require("@pipedreamhq/platform").axios(this, config)
steps.
google_maps_url
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
}
4
// construct and return the URL to view the position on Google Maps
return `http://www.google.com/maps/place/${steps.get_iss_position.$return_value.iss_position.latitude},${steps.get_iss_position.$return_value.iss_position.longitude}/@${steps.get_iss_position.$return_value.iss_position.latitude},${steps.get_iss_position.$return_value.iss_position.longitude},1z`
steps.
return_response
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
}
10
// We'll use $respond() to return an HTTP 302 response
return await $respond({
  status: 302,
  immediate: true,
  headers: {
    location: steps.google_maps_url.$return_value
  }
})