Picasa Web Access

by amindunited

HTML

<ul id="coffees"></ul>

CSS

.hovered{
    transform: scale(2);
-ms-transform: scale(2); /* IE 9 */
-webkit-transform: scale(2); /* Safari and Chrome */
-o-transform: scale(2); /* Opera */
-moz-transform: scale(2); /* Firefox */
}

JavaScript

$.getJSON( "https://picasaweb.google.com/data/feed/api/user/buckley.robin/albumid/5751950773409336513" + '' +'?alt=json&thumbsize=' + '160' , function(data){
    console.log(data);
    logImages(data);
});

function logImages(data) {
    var images = data.feed.entry;
    
    images.sort(function(a, b){
        //console.log(a.gphoto$timestamp.$t + " vs " + b.gphoto$timestamp.$t);            
        return b.gphoto$timestamp.$t - a.gphoto$timestamp.$t;
        
    });

     for ( var i = 0; i < images.length; i++ ) {
        var img = document.createElement('img');
        var li = document.createElement('li');
        $("#coffees").append(
            $(li).append( 
                $(img).attr({ 'src':images[i].content.src }).css({'width':'100px'})
            ).css({'display':'inline-block'}).addClass('coffeeShot')         
        );
    }
    
    $('.coffeeShot').each(function(i, obj){
        $(obj).on("mouseenter", function(){
            $('.coffeeShot .hovered').removeClass('hovered');
            $(this).addClass('hovered');
            $(this).on('mouseleave', function(){
                $(this).removeClass('hovered');
            })
        })
    })
    
    
}
/* To get the parent folders
$.getJSON( "http://picasaweb.google.com/data/feed/api/user/ + 'buckley.robin' +'?alt=json&thumbsize=' + '160' , function(data){
    console.log(data);
});
*/