Created
February 3, 2011 06:26
-
-
Save minrk/809123 to your computer and use it in GitHub Desktop.
Strongspace to SFTP bookmarklet
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
javascript:function ss_to_sftp(){ | |
var host=document.location.host; | |
var path=document.location.hash; | |
if (host!='www.strongspace.com'){ | |
alert('You do not appear to be at strongspace!'); | |
return; | |
} | |
var m=path.match(/^#\w+/i); | |
if (m==null){ | |
alert('you do not appear to be viewing a file'); | |
return; | |
} | |
m=m[0]; | |
var username=m.substring(1); | |
var realpath=path.substring(m.length); | |
var url='sftp://'+username+'.strongspace.com//strongspace/'+username+realpath; | |
document.location=url; | |
};ss_to_sftp(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment