rust-lang/rust-playpen — pull request #20 by riccieri (2014-06-18 05:28:47+00:00)
Title: Implement client-side url shortening with is.gd

This addresses #4. It implements URL shortening on the client-side, using the is.gd CORS API.

Some of the pros of the approach:
* Doesn't depend in any way on server-side support (thus the backend can remain stateless)
* Very simple implementation

The cons:
* We depend on a third-party
* The length of the to-be-shortened URL must not exceed 5000 characters. I've made a very crude estimate on the rustc codebase (removing comments, but not blank lines), and found out that this averages to ~158 lines of rust code. It remains to be seen whether this is enough for most uses of the playpen.

If you want to tell me why my estimate is wrong, or just enjoy reading dirty unreadable code overall, check it out: https://gist.github.com/riccieri/c554e5a4e796ea8c42c2 (uses ruby and [GNU Parallel](https://www.gnu.org/software/parallel/))