我正在使用 ROME 库来解析 Blogger Atom 提要,并且我需要读取作者缩略图的 URL。我怎样才能做到这一点?送丝不包含此元素。
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'>
<id>tag:blogger.com,1999:blog-6916314241990305466</id>
<updated>2012-03-28T06:24:27.688-07:00</updated>
<title type='text'>Padgets - City Campaign</title>
<subtitle type='html'></subtitle>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://padgets-city.blogspot.com/feeds/posts/default'/>
<link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6916314241990305466/posts/default'/>
<link rel='alternate' type='text/html' href='http://padgets-city.blogspot.com/'/>
<author>
<name>PadgetsTest</name>
<uri>http://www.blogger.com/profile/15823334142528274028</uri>
<email><a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fe90918c9b8e9287be9c929199999b8cd09d9193" rel="noreferrer noopener nofollow">[email protected]</a></email>
<!-- How to read following line? -->
<gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-TK6v5Q6uCEI/T3MQ_WqmpoI/AAAAAAAAACM/B-itCET-EMs/s220/b1.jpg'/>
</author>
<generator version='7.00' uri='http://www.blogger.com'>Blogger</generator>
</feed>
最佳答案
我已经通过实现 ROME GData 模块解决了这个问题。它仅支持 image
元素,源代码可以在https://github.com/lradziwonowicz/rome-gdata-module-skeleton找到
关于java - 如何使用 ROME 从 Atom feed 读取 "gd:image"元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9910817/