% Get the feed from Flickr.
url = 'http://api.flickr.com/services/feeds/groups_pool.gne?id=32881916@N00';
dom = xmlread(url);
% Extract the link from the feed.
links = dom.getElementsByTagName('link');
for i = 1:links.getLength()
link = links.item(i-1);
rel = char(link.getAttribute('rel'));
if strcmp(rel,'enclosure')
break
end
end
href = char(link.getAttribute('href'));
% Show the photo.
img = imread(href);
image(img)
axis equal tight
set(gca,'XTick',[],'YTick',[])
% Set the title.
entry = link.getParentNode();
eTitle = char(entry.getElementsByTagName('title').item(0).getTextContent());
eAuthor = entry.getElementsByTagName('author').item(0);
eName = char(eAuthor.getElementsByTagName('name').item(0).getTextContent());
eUrl = char(entry.getElementsByTagName('link').item(0).getAttribute('href'));
title(sprintf('"%s"\n%s',eTitle,eName))
xlabel(eUrl)
1 comment
I've been disappointed with the bacon-related-content of the photos tagged bacon from the public feed. I'm switching to the BACON Pool to see if they're more delicious.