开发者

Google Reader API HTTP Response parsing (Objective C)

开发者 https://www.devze.com 2022-12-29 06:29 出处:网络
Using the API, trying to get items in a specific feed returns this: {“direction”:”ltr”,”id”:”feed/http://arstechnica.com/index.rssx”,”title”:”Ars Technica”,”description”:”The Art of Te

Using the API, trying to get items in a specific feed returns this:

{“direction”:”ltr”,”id”:”feed/http://arstechnica.com/index.rssx”,”title”:”Ars Technica”,”description”:”The Art of Technology”,”self”:[{"href":"http://www.google.com/reader/api/0/stream/contents/feed/http://arstechnica.com/index.rssx?ot\u003d1273193172856169\u0026r\u003dn\u0026xt\u003duser/-/state/com.google/read\u0026n\u003d4\u0026ck\u003d1273193873\u0026client\u003diPadReader"}],”alternate”:[{"hre开发者_如何学编程f":"http://arstechnica.com/index.php","type":"text/html"}],”updated”:1273193873,”items”:[]}

They look like key/value pairs but it’s plain text with UTF8 String encoding and won’t encode into a dictionary. I’m using Objective-C and I’m not sure where to go from here. So far I’ve been able to parse the XML response for unread items, but parsing the plain-text doesn’t look feasible. What is your practice?


It looks like JSON markup. You'll want to use a JSON parser for Objective-C.

0

精彩评论

暂无评论...
验证码 换一张
取 消