๐Ÿ“ฆ jhstatewide / streamingjsonparser

This Ruby Gem handles the splitting of chunked JSON input.

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching
๐Ÿ“ฅ Clone https://github.com/jhstatewide/streamingjsonparser.git
HTTPS git clone https://github.com/jhstatewide/streamingjsonparser.git
SSH git clone git@github.com:jhstatewide/streamingjsonparser.git
CLI gh repo clone jhstatewide/streamingjsonparser
Joshua Harding Joshua Harding more reformatting 482fd7c 15 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ doc
๐Ÿ“ lib
๐Ÿ“ spec
๐Ÿ“„ .gitignore
๐Ÿ“„ Rakefile
๐Ÿ“„ README.md
๐Ÿ“„ VERSION
๐Ÿ“„ README.md

StreamingJSONParser ====================================

Synopsis
StreamingJSONParser allows you to receive JSON in chunks from a webserver and easily extract (hopefully) well formed JSON.

This gem was developed to interface to Riak.

Example


streamingjsonparser = StreamingJSONParser.new uri = URI.parse("http://example.com/json_stream") http = Net::HTTP.new(uri.host, uri.port) # mmm, chunky HTTP http.requestget(uri.requesturi) do |res| res.read_body do |chunk| streamingjsonparser << chunk jsondocuments = streamingjson_parser.process if json_documents.length > 0 dosomethinginterestingwith(jsondocuments) end end end