There are existing json parsing scripts, you should probably use one of those.