开发者

Regular Expression JS - HTML Parsing on the iPhone

I need to parse the following URL:

http://m.flickr.com/#/photos/westconn/

I need t开发者_C百科o get the following details:

  1. Image's URL
  2. Updated Time
  3. Title
  4. View details
  5. Command Details.

But the contents are displayed using Regular Expression JavaScript.


Based on the information you need to get, you will definitely find it easier (and more robust) to use the API provided by Flickr. It is well documented here: http://www.flickr.com/services/api/

In particular, I would point you towards flickr.people.findByUsername and flickr.people.getPublicPhotos.

There are several open-source libraries for interacting with the API, including one written in Objective-C.


Short answer: use a UIWebView, load the URL in it, and use JavaScript to query the DOM and get the data you need.

Long answer: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜