Created
September 18, 2009 17:44
-
-
Save kawahara/189186 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
function url2cmd(url) { | |
if (!url.match(/^http:\/\/gist\.github\.com\/([0-9]+)/)) { | |
pne_url2a(url); | |
return; | |
} | |
var id = RegExp.$1; | |
main(id); | |
} | |
function main(id) { | |
if (!id.match(/^[0-9]+$/)) { | |
return; | |
} | |
var html = '<script src="http://gist.github.com/' | |
+ id | |
+ '.js"></script>'; | |
document.write(html); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment