I tried two different sunrise/sunset api's. The one in the blocks below is a Dept of Homeland Sec (TSA).
I get a response that the json returned is not formatted correctly. When I send the query from my browser address bar, the site returns the correct info. Also, if I ask for an XML rather than a json response, I am also told that the XML is not formatted correctly. The api site and my aia are below the blocks picture:
If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...
which means in your case post a screenshot of your relevant blocks...
To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.
Here is a working XML based solution.
I had to convert (backslash)" to " to get the XML parseable.
I could not get JSON output, though I did not try very hard. photon_ABG.aia (4.6 KB)
I notice that the URL samples provided have their parameters given in the order
[valid parameters: eventtype, eventdate, airportcode, lat, lon, utc, dst, output]
I finally managed to decode the json. The site I got the data from was returning a json with extra stuff at the start and end. I stripped that off and decoded what remained to a list of pairs. Thanks.