Skip to content

Commit

Permalink
Flickrサイズ取得、最大サイズ制限パッチ(Tumblr対策)
Browse files Browse the repository at this point in the history
  • Loading branch information
to committed Jan 11, 2010
1 parent d84e53a commit 0b978ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions patches/model.Flickr.limitSize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
addAround(Flickr, 'getSizes', function(proceed, args, target, methodName){
const LIMIT = 3000;

return proceed(args).addCallback(function(sizes){
for(var i=sizes.length-1 ; i>=0 ; i--)
if(sizes[i].width < LIMIT && sizes[i].height < LIMIT)
break;

return sizes.slice(0, i+1);
});
});
2 changes: 2 additions & 0 deletions xpi/chrome/content/library/31_Tombloo.Service.extractors.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ Tombloo.Service.extractors = new Repository([
var info = r.info[1];
var sizes = r.sizes[1];

log(sizes);

var title = info.title._content;
ctx.title = title + ' on Flickr'
ctx.href = info.urls.url[0]._content;
Expand Down

0 comments on commit 0b978ac

Please sign in to comment.