Yikes, is that one giant unterminated array? I feel like you're not going to be able to parse that with most JSON tools because until the end arrives, it's not really valid JSON.
A lot of streaming libraries let you set a callback that responds to a "chunk" of input after it has read a certain number of bytes on the request, but it'll be tough to deal with if there's (likely) no guarantee that the chunks line up to record boundaries. Maybe you can keep a buffer of what you've received so far and pull as many valid hash objects off the string as you can, and leave the rest to prepend to the next chunk. Good luck! 🙂 On Tue, Feb 28, 2017, at 04:15 PM, Chris McCann wrote: > I'm looking into processing a stream of aircraft position data > provided here: > > http://pub-vrs.adsbexchange.com:32005 > > This effectively returns a JSON array of data structures with aircraft- > reported information including latitude and longitude positioning. > There are typically about 6000-7000 "records" provided every 5 > seconds. > > How does one parse a stream like this? You can *curl *that endpoint > and see the data, I just can't sort out how to process each record > into a JSON object to then do other stuff with. > > I've tried Ruby, Python, and Elixir but haven't come up with a > solution yet. Anyone out there have experience parsing a stream > like this? > > Cheers, > > Chris > > -- > -- > SD Ruby mailing list > sdruby@googlegroups.com > http://groups.google.com/group/sdruby > --- > You received this message because you are subscribed to the Google > Groups "SD Ruby" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to sdruby+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- -- SD Ruby mailing list sdruby@googlegroups.com http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to sdruby+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.