由於redbubble.com缺乏API,我使用ATOM feed來竊取有關用戶圖片的信息。正則表達式來獲取包含關鍵字的URL
這是XML的樣子:
<entry>
<id>ID</id>
<published>Date Published</published>
<updated>Date Updated</updated>
<link type="text/html" rel="alternate" href="http://www.redbubble.com/link/to/post"/>
<title>Title</title>
<content type="html">
Blah blah blah stuff about the image..
<a href="http://www.redbubble.com/products/configure/config-id"><img src="http://ih1.redbubble.net/path-to-image" alt="" />
</content>
<author>
<name>Author Name</name>
<uri>http://www.redbubble.com/people/author-user-name</uri>
</author>
<link type="image/jpeg" rel="enclosure" href="http://ih0.redbubble.net/path-to-the-original-image"/>
<category term="1"/>
<category term="2"/>
</entry>
基本上使用正則表達式...我將如何去獲得在內容標籤的鏈接裏面href
財產?我們知道肯定
的一件事是,它會永遠路徑中有配置即http://somesite.com/**configure**/id
所以基本上我只需要找到與配置URL,並抓住了整個事情...
什麼編程語言? – 2011-05-04 13:27:33