Permalink
Browse files

yaplog!で大きいサイズの画像をポストできるようにするパッチ。

 - largeがなかったら通常のを取得。
  • Loading branch information...
1 parent 9f126c8 commit 64183ceec4e9b3f427371fc5ce94803a9938de73 @polygonplanet committed Apr 21, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 tombloo.extractor.yaplog.photo.js
@@ -10,7 +10,7 @@
*
* -----------------------------------------------------------------------
*
- * @version 1.01
+ * @version 1.02
* @date 2012-04-21
* @author polygon planet <polygon.planet.aqua@gmail.com>
* - Blog : http://polygon-planet-log.blogspot.com/
@@ -32,10 +32,16 @@ Tombloo.Service.extractors.register([{
/^(?:\w+[.])*?yaplog[.]jp$/.test(ctx.host);
},
extract : function(ctx) {
+ var orgSrc = ctx.target.src;
ctx.target = {
src : ctx.target.src.replace(/([.][^.]+)$/, '_large$1')
};
- return Tombloo.Service.extractors['Photo'].extract(ctx);
+ return Tombloo.Service.extractors['Photo'].extract(ctx).addErrback(function() {
+ ctx.target = {
+ src : orgSrc
+ };
+ return Tombloo.Service.extractors['Photo'].extract(ctx);
+ });
}
}], 'Photo', false);

0 comments on commit 64183ce

Please sign in to comment.