Skip to content Skip to sidebar Skip to footer

How To Make An Instant Shorten Link For A Url Shortener

I have recently made a url shortener and I want to make an 'Instant Shorten' Bookmark link on my site, like YOURLS can, so you bookmark the link, then go to any webpage, then you c

Solution 1:

Usually a bookmarklet something like this is used:

javascript:u=encodeURIComponent(location.href);s='http://urlshortener.com/shorten.php?url='+u;window.open(s,'shortened','location=no,width=400,height=300');

That takes the URL of the current page and opens a new window pointing to urlshortener.com/shorten.php?url=[the url to be shortened]. The code used by YOURLS is more complicated, but probably does approximately the same thing. You just need to change the URL that the new window opens to in the code above.

Post a Comment for "How To Make An Instant Shorten Link For A Url Shortener"