flickr.interestingness (javascript template)

// flickr.interestingness by day
var r=new XMLHttpRequest(),flickr={},a=[],date="";
r.open("GET","http://api.flickr.com/services/rest/?method=flickr.interestingness.getList&api_key=940930b7b662190ae49ae54b35aff7c0007&date="+date+"&extras=tags&per_page=500&page=1&format=json&nojsoncallback=1",true);
r.onreadystatechange=function(){
	if (this.readyState==4 && this.status==200) { 
		flickr=JSON.parse(this.responseText);
		if (flickr.stat=="ok") {
			console.log(flickr.stat,flickr.photos.page,flickr.photos.photo.length);
			for (var i=0,im;i<flickr.photos.photo.length;i++) {
				im=flickr.photos.photo[i];
				a.push('http://farm'+im.farm+'.staticflickr.com/'+im.server+'/'+im.id+'_'+im.secret+'_b.jpg');
				}
				console.log (a.join("\n"));
				
			} 
		else {
			console.log(flickr.code,flickr.stat,flickr.message);
			}
		}
	}
r.send("");


/* 


http://farmfarm-id.staticflickr.com/server-id/id_o-secret_o.(jpg|gif|png)

s	small square 75x75
q	large square 150x150
t	thumbnail, 100 on longest side
m	small, 240 on longest side
n	small, 320 on longest side
-	medium, 500 on longest side
z	medium 640, 640 on longest side
c	medium 800, 800 on longest side†
b	large, 1024 on longest side*
o	original image, either a jpg, gif or png, depending on source format
* Before May 25th 2010 large photos only exist for very large original images.

† Medium 800 photos only exist after March 1st 2012.


{"id":"8201225992", "owner":"46348076@N08", "secret":"86e30a563d", "server":"8478", "farm":9, "title":"Plan\u00e8te bleue *", "ispublic":1, "isfriend":0, "isfamily":0, "tags":"blue square thistle bleu sphere squareformat chardon friendlychallenges titole"}
flickr.photos.photo
id
owner
secret
server
farm
title
ispublic
isfriend
isfamily
tags
*/
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s