Since you are new, let us show you how Trendy works.

Close-button

Today's Bacon-Related Picture

  • Created by: Matthew Simoneau
  • Latest result: Plot created
  • Created on: 02 May 2012
  • Liked: 1 time

Plot Image
% 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)
Tags:

Add Tags


1 comment

Matthew Simoneau about 2 years ago

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.