Read data from "http://www.celestrak.com/NORAD/elements/stations.txt"

Hello,

I need some help.

I need to read the data from the url “http://www.celestrak.com/NORAD/elements/stations.txt

Have tried to fellow the sample on “Making HTTP Requests in JavaScript”

A part of the file “stations.txt” looks like:

ISS (ZARYA)
1 25544U 98067A 17320.25760845 .00002780 00000-0 49193-4 0 9997
2 25544 51.6424 0.2290 0004339 120.9517 357.7535 15.54152007 85403
TIANGONG 1
1 37820U 11053A 17320.11055913 .00062943 97032-5 19309-3 0 9993
2 37820 42.7557 342.6253 0017793 85.7508 19.0465 15.91412673352067
AGGIESAT 4
1 41313U 98067HP 17319.44091328 .00076726 00000-0 29758-3 0 9996
2 41313 51.6359 300.6730 0005003 48.0078 312.1352 15.86473153102820

But until now with no result.
Please can you help me with this topic.
Thanks for any help.

Are you just trying to load the contents? Can you post the code you are currently using?

:slight_smile:

On this moment I have no code written in Javascript.
Have done this in Java as a test. ( and other languages)
For my furder program in principle i need only the first tree lines of the file, and store them in l1,l2 and l3 (variable)

Then i can proceed. Later I will it uses in NSBasic (Javascript)

Cheers, Jan

This is my code so far.

ReadFromStations.txt document.writeln("Read TLE data ISS"); var xhr = new XMLHttpRequest(); xhr.open('GET',"http://www.celestrak.com/NORAD/elements/stations.txt",false); xhr.send();
    xhr.onreadystatechange = ProcessRequest;
    
    function processRequest(e){
        document.writeln("responce");
        document.writeln(xhr.readyState);
    }

</script>