Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Commit

Permalink
Google+ストリーム上の画像を原寸大でポストできるパッチ。
Browse files Browse the repository at this point in the history
 - URLの正規表現を修正。
  • Loading branch information
polygonplanet committed Mar 8, 2012
1 parent 26cd81c commit c147bdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tombloo.extractor.googleplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*
* -----------------------------------------------------------------------
*
* @version 1.02
* @date 2011-12-13
* @version 1.03
* @date 2012-03-09
* @author polygon planet <polygon.planet@gmail.com>
* - Blog : http://polygon-planet.blogspot.com/
* - Twitter : http://twitter.com/polygon_planet
Expand All @@ -39,7 +39,7 @@ Tombloo.Service.extractors.register([{
proxy : /^(?:https?:|)\/+(?:\w+?-)*?opensocial[.]googleusercontent[.]com\//,
image : /[?].*url=([^&]+)(?:[&]|$)/i,
photo : /^(?:https?:|)\/+(?:\w+[.])*?googleusercontent[.]com\//,
resize : /\/[a-z][0-9]{1,8}(?:[\w-]*)\/(?![a-z][0-9]{1,8}(?:[\w-]*)\/)/i,
resize : /(\/[a-z][0-9]{1,8}(?:[\w-]*)\/)((?:(?![a-z][0-9]{1,8}(?:[\w-]*)\/).)*)$/i,
icon : /[?]\w+=\d+.*$|\/[a-z]\d+(?:-[a-z])*(?=\/photo[.](?:jpe?g|png|gif)$)/i
};
if (url) {
Expand All @@ -48,7 +48,7 @@ Tombloo.Service.extractors.register([{
uri = url.match(patterns.image)[1];
} else if (patterns.photo.test(url)) {
if (patterns.resize.test(url)) {
uri = url.replace(patterns.resize, '/h0/');
uri = url.replace(patterns.resize, '/h0/$2');
} else if (patterns.icon.test(url)) {
uri = url.replace(patterns.icon, '');
}
Expand Down

0 comments on commit c147bdd

Please sign in to comment.