String.prototype.supplant = function (o) {
  return this.replace(/{([^{}]*)}/g, function (a, b) {
    var r = o[b];
    return typeof r === 'string' || typeof r === 'number' ? r : a;
  });
};

function jsonFlickrApi (data) {
  
  var photo = data.photoset.photo.pop()
    , template = ['<a href="http://www.flickr.com/photos/30702620@N04/{id}">',
                  '<img src="http://farm{farm}.static.flickr.com/{server}/{id}_{secret}.jpg" />',
                  '</a>'].join('')
    , date = new Date(photo.title.replace('My face @ ', '').replace(' at', '') + ' PDT');
  
  document.getElementById('photo').innerHTML = template.supplant(photo);
  document.getElementById('photo-recency').innerHTML = humaneDate(date).toLowerCase();
  
};

