4 ms·
Link shorteners are frowned upon. There is no need to have a short URL because you have infinite characters and they can lead to bad behavior. I know reddit fi
by Guvante 12y ago
Link shorteners are frowned upon. There is no need to have a short URL because you have infinite characters and they can lead to bad behavior.
I know reddit filters them, apparently HN does too.
- steveklabnik 12y agoIt's been awkward. The reason that is from a shortener is because the program is encoded in the url. The actual URL there is http://play.rust-lang.org/?code=fn%20main%28%29%20{%0A%20%20%20%20let%20unsafe_reference%3A%20%26%28%29%20%3D%20unsafe%20{%20%3A%3Astd%3A%3Amem%3A%3Atransmute%280u%29%20}%3B%0A%20%20%20%20let%20x%20%3D%20Some%28unsafe_reference%29%3B%0A%20%20%20%20println!%28%22{}%22%2C%20x%29%0A http://play.rust-lang.org/?code=fn%20main%28%29%20{%0A%20%20...} HN displays that kinda okay, but if you don't have it looking like HN does, it can get to be almost two thousand characters.
- TheLoneWolfling 12y agoHmm... Worst compression algorithm ever: 1) make a URL containing the data to compress (perhaps base-38 encoded or something) 2) Send it to a URL shortening service 3) store the returned link 4) use it every so often to ensure the link doesn't go dead 5) profit!
- codemac 12y agoNot only that, but HN parses the full link incorrectly (the last } isn't included in the link) such that the only way for the link to have worked is to use some indirection. Like you know, a url shortener.
- Sniffnoy 12y agoWell, you can %-escape the '}'... http://play.rust-lang.org/?code=fn%20main%28%29%20{%0A%20%20%20%20let%20unsafe_reference%3A%20%26%28%29%20%3D%20unsafe%20{%20%3A%3Astd%3A%3Amem%3A%3Atransmute%280u%29%20}%3B%0A%20%20%20%20let%20x%20%3D%20Some%28unsafe_reference%29%3B%0A%20%20%20%20println!%28%22{}%22%2C%20x%29%0A%7D http://play.rust-lang.org/?code=fn%20main%28%29%20{%0A%20%20...
- dang 12y agoWe've been toying with solving the link shortener problem by replacing urls that redirect with the urls they redirect to. Would that have been bad in this case?
- yzzxy 12y agoIf this is done in an automated way, it could be an attack vector. EG. a malicious domain or link shortener owner could identify HN server IPs (or via other fingerprints, I'm not really a networks expert), learn when the HN server accesses it, and serve a different URL in only that case to replace the one in the comment. I know AOL used a similar tactic when Microsoft was racing to keep the (competing) MSN client compatible with their chat protocol after each update[0]. They wouldn't block the MSN client at known Microsoft IP addresses, so the engineers thought their solution worked, while users couldn't access AOL. Human replacement would probably work fine, and I personally think it would be a good way to deal with behavior that is often an honest mistake made out of ignorance. You might wish to surface the fact the the URL was changed subtly, however, with a color change or diacritical mark. [0] https://nplusonemag.com/issue-19/essays/chat-wars/ https://nplusonemag.com/issue-19/essays/chat-wars/