raspberrypilearning / where-is-the-space-station

2 stars 2 forks source link

JSON error - Error received when following instructions #74

Open libxx1 opened 1 year ago

libxx1 commented 1 year ago

1/1 - Community feedback received: URL: /en/projects/where-is-the-space-station

There appears to be a problem with the 'where is the space station' Python project

I'm seeing the following error message "ExternalError: SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON on line 10 in main.py

When I comment out the code associated with retrieving 'astro' data the problem 'moves' to line 21 (same instruction - different variable).

jrmhaig commented 7 months ago

The SSL API endpoint does not work. If you use http://api.open-notify.org/astros.json in step 2, 'Who is in space?', then it will work.

Likewise step 4, 'Where is the ISS?', needs to use http://api.open-notify.org/iss-now.json. There is a link on the page for this and it is currently broken.

Another problem is that, as far as I can tell, Trinket caches responses from the API and so re-running the script as suggested on step 5, 'Plotting the ISS on a map', doesn't show it moving.

(Update) Looking at the issues for the Open Notify repository it looks as though SSL has never been available. Curiously, the source of your project correctly has the non-SSL version so I guess that the process for converting the source into your projects page is 'fixing' the urls to use SSL.