I've got some Data being returned by an API that is formatted in a string, I want to convert it to an array so I can pick values out of it.
Comes in like the following:
images/20100819_202433.jpg{
"permalink": "http://burstn.com/sayhi#burst/06d67eed55d05dd545583de5b4ca3556",
"total_comments": "0",
"caption": "",
"created_at": "2010-08-20 03:24:35.759172+0000",
"coordinates": {
"latitude": "",
"longitude": ""
},
"public": "False",
"source": "wesbos_webcam",
"total_likes": "0",
"user": {
"username": "sayhi",
"display_name": null,
"permalink": "http://burstn.com/sayhi",
"profile_image": "http://www.gravatar.com/avatar.php?default=http%3A%2F%2Fburstn.com%2Fimages%2Favatar.jpg&size=100&gravatar_id=e1cb97806d9df68d0e5daec9810cb228",
"id": 357
},
"image": {
"large": "http://media.burstn.com/06d67eed55d05dd545583de5b4ca3556-large.jpg",
"width": 500,
"medium": "http://media.burstn.com/06d67eed55d05dd545583de5b4ca3556-medium.jpg",
"square": "http://media.burstn.com/06d67eed55d05dd545583de5b4ca3556-square.jpg",
"thumb": "http://media.burstn.com/06d67eed55d05dd545583de5b4ca3556-thumb.jpg",
"small": "http://media.burstn.com/06d67eed55d05dd545583de5b4ca3556-small.jpg",
"original": "http://media.burstn.com/06d67eed55d05dd545583de5b4ca3556-original.jpg",
"height": 500
},
"id": "06d67eed55d05dd545583de5b4ca3556",
"comments": {
"paging": {
"previous": "",
"next": "http://burstn.com/api/1/comments/?burst_id=06d67eed55d05dd545583de5b4ca3556&page=2"
},
"data": []
}
}
So, snip the front text off and then convery the rest into an array. How can I do this with JS?