3 ms·
longurl.org is awesome to check what is behind a shortened URL. Has an API too: http://longurl.org/api http://longurl.org/api
by r721 12y ago
longurl.org is awesome to check what is behind a shortened URL.
Has an API too: http://longurl.org/api http://longurl.org/api
- corobo 12y agoHTTP has an API for that too, just make a HEAD request to the shortened URL and see where the Location header sends you
- kuschku 12y agoYeah, sadly doesn’t always work. Goo.gl and youtu.be sometimes send an http page consisting of <!DOCTYPE html> <meta http-equiv="refresh" content="0; url=https://www.youtube.com/watch?v=opoDBF_b-fg&feature=youtu.be"> https://www.youtube.com/watch?v=opoDBF_b-fg&feature=youtu.be... Which makes it far more complicated. Another occasion where it’s appropriate to say “Fuck you, Google!” (also fuck you for disabling audio/video control on chrome mobile from JS, EXCEPT for google.com/youtube.com etc)
- warfangle 12y agoUmmm... Html5 audio/video api works just fine on chrome mobile. IOS safari is the bad actor, there ;)
- kuschku 12y agoUmmm..., no? In Chrome mobile you can only do for example .play() on an audio or video element, if you call it from an eventListener that reacted to an onClick event.
- warfangle 12y agoWell, yes. You have to initiate things that could cause bandwidth use from a user interaction instead of, say, a timeout or an XHR or a DOMContentLoaded. youtube follows the same rules as everywhere else: it doesn't autoplay. Unless you're unwittingly opening youtube urls in the app instead of chrome. iOS on the other hand actually -does- initiate bandwidth use on a <video> element, even if no interaction has taken place. If you watch Charles during an iOS video session, you will see 2-3 HTTP GETs before you even initiate playback. This can play merry hell if with your HTTP logs, if you pay attention to that sort of thing. iOS also has major issues with multiple <video> elements; <video> must be full-screen on non-tablet i-devices (you cannot create custom controls); you cannot control volume via the user interface; it uses a nonstandard progression for its status-related events... (and sometimes they're just plain missing)... I've spent the past few years working on web media players for mobile and desktop ;) I kind of know what I'm talking about. And due to its position in the marketplace, iOS Safari has stagnated - it's easier to get HTML5 multimedia working correctly in IE11 than iOS Safari. iOS Safari is the new IE6.
- userbinator 12y agoPerhaps this would be a good time to advocate link shorteners that use the standard HTTP redirect mechanism (bit.ly is one of them), so they can be HEAD'ed, and not some additional layer of obfuscation either via meta-redirect or (even worse) bury the target in some minified and obfuscated JS.
- asdfaoeu 12y agoThey don't want that because they don't want them to be automatically resolved so they can do metrics which is like 99% of the reason they are used in electronic form.
- justincormack 12y agoIf they are temporary redirects, so not cached, they can do metrics from the server logs perfectly well.
- acquiHire2014 12y agoNot if the intermediary, say, Twitter, de-shortens the link once, and then sends all the real traffic to the cached destination URLS. Not that they do that at the moment.
- kuschku 12y agoI have an IRCbot that is supposed to resolve URLs and find out if they ever end up on YouTube, and then post the video title, length and viewcount. It was an extreme hassle to implement all of this, I am partially parsing JS and the DOM just to get all those redirect services to work. It’s a huge hacky mess, but the only fast working solution. And, for the fifth time today, I can sincerely say “Fuck you, Google!”