Skip to content

Instantly share code, notes, and snippets.

@arthurnn
Created September 8, 2011 19:12
Show Gist options
  • Save arthurnn/1204385 to your computer and use it in GitHub Desktop.
Save arthurnn/1204385 to your computer and use it in GitHub Desktop.
stackoverflow
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
var json_Album_URI = "https://picasaweb.google.com/data/feed/base/"
+ "user/" + "thewoodsmyth"
+ "?alt=" + "json"
+ "&kind=" + "album"
+ "&hl=" + "en_US"
+ "&fields=" + "entry(media:group,id)"
+ "&thumbsize=" + 104;
$.getJSON(json_Album_URI,
function(data){
$.each(data.feed.entry, function(i,item){
//Thumbnail URL
$.each(item.media$group.media$thumbnail, function(i,item){
var album_thumb_URL = item.url;
$('#images').append("Album Thumbnail: " + album_thumb_URL + '<br />');
});
//Album Title
var album_Title = item.media$group.media$title.$t;
$('#images').append("Album Title: " + album_Title + '<br />');
//Album Description
var album_Description = item.media$group.media$description.$t;
$('#images').append("Album Description: " + album_Description + '<br />');
//Album ID
var album_ID = item.id.$t;
//Get Numerical ID from URL
album_ID = album_ID.split('/')[9].split('?')[0];
$('#images').append("AlbumID: " + album_ID + '<br /><br />');
var json_Photo_URI = "https://picasaweb.google.com/data/feed/base/"
+ "user/" + "thewoodsmyth"
+ "/albumid/" + album_ID
+ "?alt=" + "json"
+ "&kind=" + "photo"
+ "&hl=" + "en_US"
+ "&fields=" + "entry(media:group)"
+ "&thumbsize=" + 104;
$.ajax({
type: 'GET',
url: json_Photo_URI,
success : function(data){
$.each(data.feed.entry, function(i,item){
$('#images').append("Album Photos: <br />");
//Photo URL
$.each(item.media$group.media$content, function(i,item){
var photo_URL = item.url;
$('#images').append("Image Photo URL: " + photo_URL + '<br />');
});
//Thumbnail URL
$.each(item.media$group.media$thumbnail, function(i,item){
var photo_Thumb_URL = item.url;
$('#images').append("Image Thumbnail URL: " + photo_Thumb_URL + '<br />');
});
//Photo Title
var photo_Title = item.media$group.media$title.$t;
$('#images').append("Image Photo_Title: " + photo_Title + '<br />');
//Photo Description
var photo_Description = item.media$group.media$description.$t;
$('#images').append("Image Photo Description: " + photo_Description + '<br /><br />');
});
},
dataType: 'json',
async: false
});
});
});
});
</script>
</head>
<body>
<div id="images"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment