Created
January 4, 2012 22:13
-
-
Save jhaus/1562466 to your computer and use it in GitHub Desktop.
Google Docs Audio Player. Prefix with "javascript:" when adding to bookmarks. Bookmarklet broken as of 2010.01.04.
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 gup( name ){ | |
var cre_getDocIdelement = document.getElementById( 'gbmpm_0_l' ); | |
name = name.replace( /[\[]/,"\\\[" ).replace( /[\]]/,"\\\]" ); | |
var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
var regex = new RegExp( regexS ); | |
var results = regex.exec( cre_getDocIdelement ); | |
if( results == null ) return ""; | |
else return results[1]; | |
} | |
var cre_id = gup( 'id' ); | |
var cre_redirecturl = 'https://docs.google.com/uc?export=player&id=' + cre_id; | |
top.location = cre_redirecturl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment