Skip to content

Instantly share code, notes, and snippets.

@silverjam
Created July 1, 2010 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silverjam/460026 to your computer and use it in GitHub Desktop.
Save silverjam/460026 to your computer and use it in GitHub Desktop.
/* Buzz bookmarklet, this should work on older browsers*/
var e=encodeURIComponent;
var b='http://www.google.com/buzz/post';
var u=e(document.location.href);
var els=document.getElementsByTagName('meta');
var o=null;
for(var i=0;i<els.length;i++){
if(els[i].name=='description'){
o=els[i];
break;
}}
var m='';if(o!=null)m=e(o.content);
var a='resizable=0,scrollbars=0,width=690,height=415';
window.open(b+'?url='+u+'&message='+m,'_blank',a);
void(0)
/* Compressed version, this would be placed in "location" of bookmark:
javascript:e=encodeURIComponent;b='http://www.google.com/buzz/post';u=e(document.location.href);els=document.getElementsByTagName('meta');o=null;for(i=0;i<els.length;i++){if(els[i].name=='description'){o=els[i];break;}}m='';if(o!=null)m=e(o.content);a='resizable=0,scrollbars=0,width=690,height=415';window.open(b+'?url='+u+'&message='+m,'_blank',a);void(0)
*/
/*Buzz bookmarklet, uses querySelector, works on FF 3.5+, Chrome, IE8+, Safari 4*/
var e=encodeURIComponent;
var b='http://www.google.com/buzz/post';
var u=e(document.location.href);
var o=document.querySelector('meta[name=description]');
var m='';if(o!=null)m=e(o.content);
var a='resizable=0,scrollbars=0,width=690,height=415';
window.open(b+'?url='+u+'&message='+m,'_blank',a);
void(0)
/* Compressed version, this would be placed in "location" of bookmark:
javascript:var e=encodeURIComponent;var b='http://www.google.com/buzz/post';var u=e(document.location.href);var o=document.querySelector('meta[name=description]');var m='';if(o!=null)m=e(o.content);var a='resizable=0,scrollbars=0,width=690,height=415';window.open(b+'?url='+u+'&message='+m,'_blank',a);void(0)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment