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:
- Image's URL
- Updated Time
- Title
- View details
- 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
精彩评论