Created
June 7, 2010 07:46
-
-
Save romannurik/428350 to your computer and use it in GitHub Desktop.
This file contains 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
// ==ClosureCompiler== | |
// @output_file_name google-buzz-bookmarklet.js | |
// @compilation_level SIMPLE_OPTIMIZATIONS | |
// ==/ClosureCompiler== | |
// Buzz API - Buttons: http://code.google.com/apis/buzz/buttons_and_gadgets.html#post_to_google_buzz | |
// Closure Compiler Service: http://closure-compiler.appspot.com/home | |
(function(){ | |
var url = window.location.href; | |
var title = document.title; | |
var text = window.getSelection ? window.getSelection().toString() : (document.selection ? document.selection.createRange().text : ''); | |
window.open( | |
'http://www.google.com/buzz/post' + | |
'?message=' + window.encodeURIComponent(title + (text ? '\n\n\"' + text + '\"': '')) + | |
'&url=' + window.encodeURIComponent(url), | |
'_blank', | |
'resizable=0,scrollbars=0,width=690,height=415' | |
); | |
})() |
This file contains 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
1. Create a new bookmark | |
2. Name it "Post to Google Buzz" | |
3. Set the address to: | |
javascript:(function(){var b=window.location.href,c=document.title,a=window.getSelection?window.getSelection().toString():document.selection?document.selection.createRange().text:"";window.open("http://www.google.com/buzz/post?message="+window.encodeURIComponent(c+(a?'\n\n"'+a+'"':""))+"&url="+window.encodeURIComponent(b),"_blank","resizable=0,scrollbars=0,width=690,height=415")})(); |
Right... it'd be bad if that hyperlink actually worked.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!
Edit: Tried to put a hyperlink here for drag-and-drop, but of course it got sanitized. Silly me.