[Realtime-feed-users] XML-based Atom Feed format problems with malformed UTF-8 characters
Leif AMO
leif.amo at gmail.com
Mon Mar 13 20:42:43 UTC 2017
On 2017-03-13 10:01, Martinez, Eric wrote:
> I have logged your report as
> a bug on the project
> here: https://github.com/usgs/earthquake-event-ws/issues/224.
Thanks for that!
> We will
> work to correct this issue in the future however we do /recommend/ any
> and all programmatic access to our data use the GeoJSON format.
I inherited this add-on code about a year ago when I took over the free
software project, and got the feed code working, but didn't know enough
to go about changing it, feared it might be too difficult, so I left it
alone until it broke.
With a year of experience with this programming environment, I changed
the feed reading from Atom to GeoJSON within a matter of seconds. The
process consisted of deleting all the convoluted XML DOM nested for
loops, and doing a single for loop and direct assignment of only the
properties I wanted.
Aside from 2 small errors in code due to typos, once corrected,
everything worked as expected. It was virtually effortless and
painless. The hardest part about the whole process was essentially to
read the XMLHttpRequest docs and set `xhr.responseType = 'json';`, and
then to look at `xhr.response` instead of xhr.responseXML.
Left it running for a few hours as a test. Works just fine!
--
Leif
More information about the Realtime-feed-users
mailing list