2013-03-20 2 views
1

페이스 북 피드를 구문 분석하고 싶습니다. 여기 Parse Facebook Feed Json 데이터

내 JSON의 URL입니다 :

"content": "\u003Ca href=\"\/l.php?u=http\u00253A\u00252F\u00252Fwww.youtube.com\u00252Fwatch\u00253Fv\u00253D9_PaHtaKAug\u002526list\u00253DPLc4q0uG_h6x5tA_L3kHK6TE9TV6skf14n\u002526index\u00253D1\u002526feature\u00253Dplpp_video&h=0AQEQfrMH&s=1\" id=\"\" title=\"\" target=\"\" onclick=\"LinkshimAsyncLink.swap(this, "\\\/l.php?u=http\\u00253A\\u00252F\\u00252Fwww.youtube.com\\u00252Fwatch\\u00253Fv\\u00253D9_PaHtaKAug\\u002526list\\u00253DPLc4q0uG_h6x5tA_L3kHK6TE9TV6skf14n\\u002526index\\u00253D1\\u002526feature\\u00253Dplpp_video&h=0AQEQfrMH&s=1");\" style=\"\" rel=\"nofollow\" onmouseover=\"LinkshimAsyncLink.swap(this, "http:\\\/\\\/www.youtube.com\\\/watch?v=9_PaHtaKAug&list=PLc4q0uG_h6x5tA_L3kHK6TE9TV6skf14n&index=1&feature=plpp_video");\">\u003Cimg class=\"img\" src=\"http:\/\/external.ak.fbcdn.net\/safe_image.php?d=AQDshpKwwDhCYH9k&w=130&h=130&url=http\u00253A\u00252F\u00252Fi2.ytimg.com\u00252Fvi\u00252F9_PaHtaKAug\u00252Fmqdefault.jpg\" alt=\"\" style=\"height:90px;\" \/>\u003C\/a>\u003Cbr\/>\u003Ca href=\"\/l.php?u=http\u00253A\u00252F\u00252Fwww.youtube.com\u00252Fwatch\u00253Fv\u00253D9_PaHtaKAug\u002526list\u00253DPLc4q0uG_h6x5tA_L3kHK6TE9TV6skf14n\u002526index\u00253D1\u002526feature\u00253Dplpp_video&h=PAQEzb06t&s=1\" id=\"\" target=\"_blank\" onclick=\"LinkshimAsyncLink.swap(this, "\\\/l.php?u=http\\u00253A\\u00252F\\u00252Fwww.youtube.com\\u00252Fwatch\\u00253Fv\\u00253D9_PaHtaKAug\\u002526list\\u00253DPLc4q0uG_h6x5tA_L3kHK6TE9TV6skf14n\\u002526index\\u00253D1\\u002526feature\\u00253Dplpp_video&h=PAQEzb06t&s=1");\" style=\"\" rel=\"nofollow\" onmouseover=\"LinkshimAsyncLink.swap(this, "http:\\\/\\\/www.youtube.com\\\/watch?v=9_PaHtaKAug&list=PLc4q0uG_h6x5tA_L3kHK6TE9TV6skf14n&index=1&feature=plpp_video");\">The Dissident Files - Ausama Monajed at THiNK 2012\u003C\/a>\u003Cbr\/>www.youtube.com\u003Cbr\/>Ausama Monajed in conversation with NDTV's Vishnu Som in Tehelka's THiNK 2012 session on "The Troubled Looking Glass: Why You Should Care About Syria" For mo... " 

그것은 이미지 로고 URL, 동영상 URL, .... 그래서 어떻게 구문 분석 할 수 있습니다 포함되어 있습니다 그래서 응답 데이터의 유형을 가지고

http://www.facebook.com/feeds/page.php?id=199009743552420&format=json 이 유형의 데이터?

도와주세요. 당신에게

+0

http://stackoverflow.com/questions/9661845/json-parser -example-for-ios5 – Ultrakorne

+0

@Ultrakorne json 데이터를 구문 분석하는 방법을 알고 있지만 @ "Content"키에 대한 데이터를 구문 분석하려고합니다. – saurabh

+0

콘텐츠 json 필드의 문자열, html 코드가 있으면. – pdrcabrod

답변

0

당신은 JSON에서 분석 내용 필드가되면, 당신은 지금 당신이 HTML 코드를 다루고있는 염두에두고 다시 구문 분석해야합니다 하라구요

. 복잡한 쿼리를 수행하려면 libxml2 라이브러리에서 XPath를 사용해야합니다.

참조 : 당신은 단지 간단한 쿼리를 수행 할 경우 iOS: Best way to parse html tags?

, 당신은 문자열을 반복하고 당신이 원하는 것을 따기 수