4 ms·
Node-unshortener can unshort any url
- Thasc 16y agoNot now it got Hacker News-bombed it can't.
- Swizec 16y agoWhile my blog is being bombed, you can check out the github link here --> https://github.com/Swizec/node-unshortener https://github.com/Swizec/node-unshortener edit: back up now.
- soult 16y agoNice work! Using the official APIs as much as possible is usually a good move because most shorteners not only use 301/Location header redirects, but often use pages with messages like "this page has been marked as spam, do you want to proceed?" and "this page returns a 404, want to go to our ad supported search engine to find a similar page instead?". Of course the above is not universally true, and as someone who has implemented a similar library, I learned that most URL shorteners have various quirks. E.g., Is.gd does not tell you via their API[0] what the real url[1] of a blocked site is, and TinyURL (which has many[2] different[3] non-redirect[4] pages[5]) doesn't offer an API at all. 0: http://is.gd/forward.php?format=simple&shorturl=mBAh http://is.gd/forward.php?format=simple&shorturl=mBAh 1: http://is.gd/mBAh http://is.gd/mBAh 2: http://tinyurl.com/cs http://tinyurl.com/cs 3: http://tinyurl.com/w http://tinyurl.com/w 4: http://tinyurl.com/dick http://tinyurl.com/dick 5: http://tinyurl.com/bvkke http://tinyurl.com/bvkke
- geekboys 16y agoWhy not just follow redirects instead? All proper URL-shortening services would work no matter of API. And just add support for those that does it via IFRAME. much more convenient.
- sixtofour 16y agoI've thought for some time that url shortening and expanding should be an RFC, done in the browser, the same across browsers.