What kind of code would I need in order to take exactly what I want from this block of text.
I just want to extract names and messages… maybe i need some help with numerical literals to create a complex pattern to search for but i’m really not sure.
Ok so here is the text:
{
“data”: [
{
“id”: “572502175_141659879224245”,
“from”: {
“name”: “Ali Ryan”,
“id”: “572502175”
},
“message”: “no more flu means I HAVE to start my FYP… :(”,
“actions”: [
{
“name”: “Comment”,
“link”: “http://www.facebook.com/572502175/posts/141659879224245”
},
{
“name”: “Like”,
“link”: “http://www.facebook.com/572502175/posts/141659879224245”
}
],
“type”: “status”,
“created_time”: “2011-01-05T15:38:12+0000”,
“updated_time”: “2011-01-05T15:51:59+0000”,
“likes”: 1,
“comments”: {
“data”: [
{
“id”: “572502175_141659879224245_1194858”,
“from”: {
“name”: “Ali Ryan”,
“id”: “572502175”
},
“message”: “ha you’re slightly evil”,
“created_time”: “2011-01-05T15:51:13+0000”
},
{
“id”: “572502175_141659879224245_1194864”,
“from”: {
“name”: “Conor Brosnahan”,
“id”: “810195525”
},
“message”: “E-vul?\n\nhttp://www.youtube.com/watch?v=7edeOEuXdMU”,
“created_time”: “2011-01-05T15:51:59+0000”,
“likes”: 1
}
],
“count”: 9
}
},
{
“id”: “1169931381_1616293365120”,
“from”: {
“name”: “Holly Ni Ghrada”,
“id”: “1662583590”
},
“to”: {
“data”: [
{
“name”: “Joey Kelly”,
“id”: “1169931381”
}
]
},
“message”: “nollaig shona agus ath bhlian faoi mhaise! when ya back up to limerick for hard work on the fyp?! bottles of f\u00edon dearg are awaiting us buddy!!”,
“actions”: [
{
“name”: “Comment”,
“link”: “http://www.facebook.com/1169931381/posts/1616293365120”
},
{
“name”: “Like”,
“link”: “http://www.facebook.com/1169931381/posts/1616293365120”
}
],
“type”: “status”,
“created_time”: “2011-01-03T21:02:53+0000”,
“updated_time”: “2011-01-04T18:24:05+0000”,
“comments”: {
“data”: [
{
“id”: “1169931381_1616293365120_913192”,
“from”: {
“name”: “Joey Kelly”,
“id”: “1169931381”
},
“message”: “Mar an c\u00e9anna duitse Holly! Hope ye had a good one! I was gona go back soon but wanadem water tanks in the attic of our gaff in Thomand burst over the christmas, and now the place smells like a hamster cage, so I might hold off for a bit! Maybe towards the end den seachtain seo chugainn. We certainly must clink a few bottles soon! Are you above in Limerick?”,
“created_time”: “2011-01-04T16:37:00+0000”
}
And what I would like to print out from that is something like this:
Name: Ali Ryan
Message: no more flu means I HAVE to start my FYP.... :(
Name: Ali Ryan
Message: ha you're slightly evil
Name: Conor Brosnahan
Message: E-vul?\n\nhttp://www.youtube.com/watch?v=7edeOEuXdMU
Name: Holly Ni Ghrada
Name: Joey Kelly
Message: nollaig shona agus ath bhlian faoi mhaise! when ya back up to limerick for hard work on the fyp?! bottles of f\u00edon dearg are awaiting us buddy!!
Could somebody please help me out?