From: Marcin Raczkowski Date: 2007-04-03T07:26:46+09:00 Subject: Re: JSON Parser On Monday 02 April 2007 12:09, Rama Singh wrote: > James Gray wrote: > > On Apr 2, 2007, at 6:01 AM, Rama Singh wrote: > >>>> ',' or '}' in object at '"Val > >>>> ue":"",}},"MetaC'! (JSON::ParserError) > >>> > >>> ^ > >>> This isn't allowed in a valid JSON text. > >> > >> I think this time you understood what actually i am looking for : > >> > >> 1. I get AsJSON data. > >> 2. I want to parse JSON data in ruby. > > > > But as Florian said, you JSON data is not valid JSON. That's why the > > Ruby parser won't parse it. > > > > James Edward Gray II > > Thanks Florian. > Thanks James, I found the error in JSON txt. > > My last question is there any online website, where i can paste my JSON > data into textarea and i can check from there regarding JSON validation. > > Thanks > > Rama ~ irb require 'json' begin @l = File.open($*[0], "r") { |f| f.readlines } rescue Exception puts "could not open file" end begin JSON.unparse(@l) puts "it's valid JSON" rescue Exception puts "it's not valid JSON" end