ISS alerter
Posted: 27 Oct 2018 11:18
I'm currently working on a script that will inform me when the ISS (International Space Station) is above my location.
More information about the api here http://open-notify.org/Open-Notify-API/
I have the URL with my longitude and latitude
http://api.open-notify.org/iss-pass.jso ... -2.1586632
Not even sure if I'm doing this the right way as they show this on the site:
This is the reply I get back from the api:
I only need the duration and the risetimes for my script which will eventually send me a page message to let me know when the ISS is above me.
What would be the best way to work with this data from the api?
so that I can achieve the following:
Get 5 sets of dates and times and also the duration for each set.
Look forward to your replies with this one and thanks in advance.
More information about the api here http://open-notify.org/Open-Notify-API/
I have the URL with my longitude and latitude
http://api.open-notify.org/iss-pass.jso ... -2.1586632
Not even sure if I'm doing this the right way as they show this on the site:
Code: Select all
$.getJSON('http://api.open-notify.org/iss-pass.json?lat=45.0&lon=-122.3&alt=20&n=5&callback=?', function(data) {
data['response'].forEach(function (d) {
var date = new Date(d['risetime']*1000);
$('#isspass').append('<li>' + date.toString() + '</li>');
});
});
Code: Select all
{
"message": "success",
"request": {
"altitude": 100,
"datetime": 1540638319,
"latitude": 52.6138046,
"longitude": -2.1586632,
"passes": 5
},
"response": [
{
"duration": 556,
"risetime": 1540642292
},
{
"duration": 481,
"risetime": 1540702554
},
{
"duration": 621,
"risetime": 1540708228
},
{
"duration": 643,
"risetime": 1540713992
},
{
"duration": 641,
"risetime": 1540719778
}
]
}
What would be the best way to work with this data from the api?
so that I can achieve the following:
Get 5 sets of dates and times and also the duration for each set.
Look forward to your replies with this one and thanks in advance.