Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

JSON.parse fails #227

Closed
jstockton opened this Issue · 1 comment

2 participants

@jstockton

I'm trying to use the Viper Smart Start plugin which parses a response from a PHP page. Everything works up until the script tries to parse the result from the PHP page and I haven't been able to figure out why it is failing. I know that the openuri is working because I am able to start my car and have confirmed that I do get a result from the PHP page so Im pretty confident its something to do with JSON.parse. Here are a couple of lines from the script:

status = JSON.parse(open(URI("#{self.url}?action=#{viper_command}")).read)
...
...
if(status["Return"]["ResponseSummary"]["StatusCode"] == 0)

I put some debug statements right after the call to JSON.parse and the code gets there, but as soon as it tries to access the status object, Siri just hangs and has to be manually stopped since it never reaches request_completed. Whats strange is that I have been able to take some of the code and run it irb and I can see the value of status["Return"]["ResponseSummary"]["StatusCode"]. Any ideas why parsing fails in the script but not in irb?

@plamoni
Owner
@jstockton jstockton closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.