Skip to content

Instantly share code, notes, and snippets.

@oampo
Created August 19, 2015 10:21
Show Gist options
  • Save oampo/75a49034555753afb0b7 to your computer and use it in GitHub Desktop.
Save oampo/75a49034555753afb0b7 to your computer and use it in GitHub Desktop.
ISS Finder M1
var axios = require('axios');
var findPassTime = function(latitude, longitude) {
return axios.get('http://api.open-notify.org/iss-pass.json', {
params: {
lat: latitude,
lon: longitude
}
})
.then(function(response) {
return new Date(response.data.response[0].risetime * 1000);
})
};
var latitude = process.argv[2];
var longitude = process.argv[3];
findPassTime(latitude, longitude)
.then(function(date) {
return console.log(date);
})
.catch(function(err) {
console.error(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment