code_junkie

rel-tag bookmarklet for last path component of a URL

Nov 12th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. var NewUrl = 'http://technorati.com/tag/';
  2. var LastPart = location.pathname.match( /[^/]+/?$/ );
  3. window.open( NewUrl + LastPart );
  4.  
  5. ^[a-z]+://[^/#?]+/[^#?]*?([^#?/]+)(?:[#?]|$)
  6.  
  7. ^([^#?]*?)/?(?:[#?]|$)
  8.  
  9. $1/tag
Add Comment
Please, Sign In to add comment