On a few occasions recently I’ve had to deal with long URLs, or more accurately, URLs with long querystrings. Each time it was a chore: strings that are a few hundred characters in length are unwieldy, hard to read and tricky to edit. So I decided to make my life easier and build a tool.
This URL is the kind of thing one encounters when working with Web Map Services:
It returns a geographic map image based upon the name/value pairs passed in the querystring. Google Charts work in a similar way:
To tackle such long URLs I’ve developed the boringly-named URL Editor.
Find it here: http://gingerbbm.com/urleditor
Once a URL has been split, any edits to the individual values are immediately applied to the main URL, and vice versa.
The Encode and Decode buttons attempt to encode/decode any relevant values that exist.
Click Open to open the URL in its current state in a new window/tab. And Reset resets the whole page.
Reordering of name/value pairs is achieved by dragging them, and you can add and delete them by clicking the relevant buttons.
It wouldn’t be hard to trip the application up. The key to it all is the question mark character that denotes the start of a querystring. If you’re not interested in ever opening the URL you can simply start typing into the main box, e.g. “?a=1”, and the name/value pairs will appear.
So, “URL Editor” is a fairly sober moniker, but it was the best of a bad bunch, and being a pretty good description of what it does I decided to go with it.
- U.R.[NOT HEL]L.
- URL Manager
- URL Splitter
- Querystring Dechunker
- Any ideas?
I’ve tried it out in FF3, IE8, Safari 3 and Opera 9 on XP and it’s all good. It also appears to work in FF3 and Safari 3 on the Mac. Not tried it on Chrome yet, but I don’t expect any surprises. For me it’s been fairly robust, and a useful tool in my arsenal. I hope others find it useful.