Created
June 23, 2011 04:57
-
-
Save davidcalhoun/1041931 to your computer and use it in GitHub Desktop.
Google reader subscribe bookmarklet (opens in new window)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){var k=void 0,n=null,o;var r=this;function s(){} | |
function t(a){var c=typeof a;if(c=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return c;var b=Object.prototype.toString.call(a);if(b=="[object Window]")return"object";if(b=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(b=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if(c=="function"&&typeof a.call=="undefined")return"object";return c} | |
var u="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36),aa=0;function v(a,c){function b(){} | |
b.prototype=c.prototype;a.v=c.prototype;a.prototype=new b} | |
var ba=/^[a-zA-Z0-9\-_.!~*'()]*$/;function ca(a){a=String(a);return!ba.test(a)?encodeURIComponent(a):a} | |
function da(a,c){for(var b=0,e=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=String(c).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=Math.max(e.length,f.length),g=0;b==0&&g<d;g++){var j=e[g]||"",h=f[g]||"",i=RegExp("(\\d*)(\\D*)","g"),p=RegExp("(\\d*)(\\D*)","g");do{var m=i.exec(j)||["","",""],l=p.exec(h)||["","",""];if(m[0].length==0&&l[0].length==0)break;b=w(m[1].length==0?0:parseInt(m[1],10),l[1].length==0?0:parseInt(l[1],10))||w(m[2].length==0,l[2].length==0)||w(m[2],l[2])}while(b==0)} | |
return b} | |
function w(a,c){if(a<c)return-1;else if(a>c)return 1;return 0} | |
var x=Array.prototype,ea=x.indexOf?function(a,c,b){return x.indexOf.call(a,c,b)}:function(a,c,b){b=b==n?0:b<0?Math.max(0,a.length+b):b;if(typeof a=="string")return typeof c!="string"||c.length!=1?-1:a.indexOf(c,b);for(;b<a.length;b++)if(b in a&&a[b]===c)return b;return-1},y,z,A,B,fa;function ga(){return r.navigator?r.navigator.userAgent:n} | |
function C(){return r.navigator} | |
B=A=z=y=!1;var D;if(D=ga()){var ha=C();y=D.indexOf("Opera")==0;z=!y&&D.indexOf("MSIE")!=-1;A=!y&&D.indexOf("WebKit")!=-1;B=!y&&!A&&ha.product=="Gecko"} | |
var ia=y,E=z,F=B,ja=A,ka=C();fa=(ka&&ka.platform||"").indexOf("Mac")!=-1;C()&&C();var G;a:{var H="",I;if(ia&&r.opera)var J=r.opera.version,H=typeof J=="function"?J():J;else if(F?I=/rv\:([^\);]+)(\)|;)/:E?I=/MSIE\s+([^\);]+)(\)|;)/:ja&&(I=/WebKit\/(\S+)/),I)var la=I.exec(ga()),H=la?la[1]:"";if(E){var K,ma=r.document;K=ma?ma.documentMode:k;if(K>parseFloat(H)){G=String(K);break a}} | |
G=H} | |
var na=G,oa={};function L(a){return oa[a]||(oa[a]=da(na,a)>=0)} | |
var pa=new Function("a","return a"),M;!E||L("9");E&&L("8");function N(){} | |
N.prototype.o=!1;N.prototype.g=function(){if(!this.o)this.o=!0,this.d()};N.prototype.d=function(){};function O(a,c){this.type=a;this.currentTarget=this.target=c} | |
v(O,N);O.prototype.d=function(){delete this.type;delete this.target;delete this.currentTarget};O.prototype.k=!1;O.prototype.B=!0;function P(a,c){a&&this.i(a,c)} | |
v(P,O);o=P.prototype;o.target=n;o.relatedTarget=n;o.offsetX=0;o.offsetY=0;o.clientX=0;o.clientY=0;o.screenX=0;o.screenY=0;o.button=0;o.keyCode=0;o.charCode=0;o.ctrlKey=!1;o.altKey=!1;o.shiftKey=!1;o.metaKey=!1;o.A=!1;o.p=n;o.i=function(a,c){var b=this.type=a.type;O.call(this,b);this.target=a.target||a.srcElement;this.currentTarget=c;var e=a.relatedTarget;if(e){if(F){var f;a:{try{pa(e.nodeName);f=!0;break a}catch(d){} | |
f=!1} | |
f||(e=n)}}else if(b=="mouseover")e=a.fromElement;else if(b=="mouseout")e=a.toElement;this.relatedTarget=e;this.offsetX=a.offsetX!==k?a.offsetX:a.layerX;this.offsetY=a.offsetY!==k?a.offsetY:a.layerY;this.clientX=a.clientX!==k?a.clientX:a.pageX;this.clientY=a.clientY!==k?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(b=="keypress"?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.A=fa?a.metaKey:a.ctrlKey;this.state=a.state;this.p=a;delete this.B;delete this.k};o.d=function(){P.v.d.call(this);this.relatedTarget=this.currentTarget=this.target=this.p=n};function Q(a,c){this.s=c;this.b=[];if(a>this.s)throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");for(var b=0;b<a;b++)this.b.push(this.a?this.a():{})} | |
v(Q,N);Q.prototype.a=n;Q.prototype.m=n;function R(a,c){a.b.length<a.s?a.b.push(c):qa(a,c)} | |
function qa(a,c){if(a.m)a.m(c);else{var b=t(c);if(b=="object"||b=="array"||b=="function")if(t(c.g)=="function")c.g();else for(var e in c)delete c[e]}} | |
Q.prototype.d=function(){Q.v.d.call(this);for(var a=this.b;a.length;)qa(this,a.pop());delete this.b};var ra,sa=(ra="ScriptEngine"in r&&r.ScriptEngine()=="JScript")?r.ScriptEngineMajorVersion()+"."+r.ScriptEngineMinorVersion()+"."+r.ScriptEngineBuildVersion():"0";function ta(){} | |
var ua=0;o=ta.prototype;o.key=0;o.f=!1;o.l=!1;o.i=function(a,c,b,e,f,d){if(t(a)=="function")this.r=!0;else if(a&&a.handleEvent&&t(a.handleEvent)=="function")this.r=!1;else throw Error("Invalid listener argument");this.j=a;this.u=c;this.src=b;this.type=e;this.w=!!f;this.z=d;this.l=!1;this.key=++ua;this.f=!1};o.handleEvent=function(a){return this.r?this.j.call(this.z||this.src,a):this.j.handleEvent.call(this.j,a)};var S,T,U,va,V,W,X,wa;(function(){function a(){return{c:0,e:0}} | |
function c(){return[]} | |
function b(){function l(q){return g.call(l.src,l.key,q)} | |
return l} | |
function e(){return new ta} | |
function f(){return new P} | |
var d=ra&&!(da(sa,"5.7")>=0),g;va=function(l){g=l};if(d){S=function(l){R(j,l)};T=function(){return h.b.length?h.b.pop():h.a?h.a():{}};U=function(l){R(h,l)};V=function(){R(i,b())};W=function(l){R(p,l)};X=function(){return m.b.length?m.b.pop():m.a?m.a():{}};wa=function(l){R(m,l)};var j=new Q(0,600);j.a=a;var h=new Q(0,600);h.a=c;var i=new Q(0,600);i.a=b;var p=new Q(0,600);p.a=e;var m=new Q(0,600);m.a=f}else S=s,T=c,W=V=U=s,X=f,wa=s})();var Y={},Z={},xa={},ya={};function za(a,c,b,e){if(!e.h&&e.t){for(var f=0,d=0;f<e.length;f++)if(e[f].f){var g=e[f].u;g.src=n;V(g);W(e[f])}else f!=d&&(e[d]=e[f]),d++;e.length=d;e.t=!1;d==0&&(U(e),delete Z[a][c][b],Z[a][c].c--,Z[a][c].c==0&&(S(Z[a][c]),delete Z[a][c],Z[a].c--),Z[a].c==0&&(S(Z[a]),delete Z[a]))}} | |
function Aa(a,c,b,e,f){var d=1,c=c[u]||(c[u]=++aa);if(a[c]){a.e--;a=a[c];a.h?a.h++:a.h=1;try{for(var g=a.length,j=0;j<g;j++){var h=a[j];h&&!h.f&&(d&=Ba(h,f)!==!1)}}finally{a.h--,za(b,e,c,a)}} | |
return Boolean(d)} | |
function Ba(a,c){var b=a.handleEvent(c);if(a.l){var e=a.key;if(Y[e]){var f=Y[e];if(!f.f){var d=f.src,g=f.type,j=f.u,h=f.w;d.removeEventListener?(d==r||!d.C)&&d.removeEventListener(g,j,h):d.detachEvent&&d.detachEvent(g in ya?ya[g]:ya[g]="on"+g,j);d=d[u]||(d[u]=++aa);j=Z[g][h][d];if(xa[d]){var i=xa[d],p=ea(i,f);p>=0&&x.splice.call(i,p,1);i.length==0&&delete xa[d]} | |
f.f=!0;j.t=!0;za(g,h,d,j);delete Y[e]}}} | |
return b} | |
va(function(a,c){if(!Y[a])return!0;var b=Y[a],e=b.type,f=Z;if(!(e in f))return!0;var f=f[e],d,g;M===k&&(M=E&&!r.addEventListener);if(M){var j;if(!(j=c))a:{j="window.event".split(".");for(var h=r;d=j.shift();)if(h[d]!=n)h=h[d];else{j=n;break a} | |
j=h} | |
d=j;j=!0 in f;h=!1 in f;if(j){if(d.keyCode<0||d.returnValue!=k)return!0;a:{var i=!1;if(d.keyCode==0)try{d.keyCode=-1;break a}catch(p){i=!0} | |
if(i||d.returnValue==k)d.returnValue=!0}} | |
i=X();i.i(d,this);d=!0;try{if(j){for(var m=T(),l=i.currentTarget;l;l=l.parentNode)m.push(l);g=f[!0];g.e=g.c;for(var q=m.length-1;!i.k&&q>=0&&g.e;q--)i.currentTarget=m[q],d&=Aa(g,m[q],e,!0,i);if(h){g=f[!1];g.e=g.c;for(q=0;!i.k&&q<m.length&&g.e;q++)i.currentTarget=m[q],d&=Aa(g,m[q],e,!1,i)}}else d=Ba(b,i)}finally{if(m)m.length=0,U(m);i.g();wa(i)} | |
return d} | |
e=new P(c,this);try{d=Ba(b,e)}finally{e.g()} | |
return d});function Ca(a){if(a[1]){var c=a[0],b=c.indexOf("#");b>=0&&(a.push(c.substr(b)),a[0]=c=c.substr(0,b));b=c.indexOf("?");b<0?a[1]="?":b==c.length-1&&(a[1]=k)} | |
return a.join("")}!E||L("9");!F&&!E||E&&L("9")||F&&L("1.9.1");E&&L("9");E&&L(8);if(window._LOGIN_URL===k){var $;window._IS_MULTILOGIN_ENABLED?($=Da("AddSession",!0),$+="&Email="+encodeURIComponent(_USER_EMAIL)):$=Da("ServiceLogin",!0);_LOGIN_URL=$} | |
function Da(a,c){var b="https://www.google.com/accounts/"+a+"?service=reader&passive=true&nui=1<mpl=default";if(c){var e;try{e=window.top.location.href}catch(f){e=window.location.href} | |
b+="&continue="+encodeURIComponent(e)+"&followup="+encodeURIComponent(e)} | |
return b}(function(){function a(h){return h&&h.match(/[\+\/]xml$/)} | |
function c(h){var i=h,p=window.document.location;h.indexOf("/")!=0&&(i=p.pathname.split("/"),i[i.length-1]=h,i=i.join("/"));return p.protocol+"//"+p.hostname+i} | |
for(var b=!1,e=document.getElementsByTagName("link"),f=0,d;d=e[f];f++){var g=d.getAttribute("type"),j=d.getAttribute("rel");if(a(g)&&j&&j=="alternate"){b=d.getAttribute("href");b.indexOf("http")!=0&&(b=c(b));b=(window.GR________bookmarklet_domain?window.GR________bookmarklet_domain:"http://www.google.com")+"/reader/view/feed/"+encodeURIComponent(b);window.GR________AT&&(b=Ca([b,"&","at","=",ca(window.GR________AT)]));window.open(b,'_blank');b=!0;break}} | |
b||alert("Oops. Can't find a feed.")})();})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment