ajstiles/urly — pull request #6 by thomseddon (2011-11-08 18:44:35+00:00)
Title: Added support for multiple query params in long URL

Firstly, urly is great! Really fast and simple, has been easy enough to customise, so thank you!

This I have made that I think would be useful for everyone...

When you send a request with a url with more than one query parameter, like so:

```
http://www.thomseddon.co.uk/?a=1&b=2&c=3
```

urly only grabs the first param, so the shortened domain is like so:

```
http://www.thomseddon.co.uk/?a=1
```
this is because the url is obtained through response.get('href'), and the other query params are interpreted as separate from the href param!
I have overcome this by looping though every param and each that isn't the reserved "href" or "title" are concatenated onto the href, like so:

```python
base = self.request.get('href')
params = self.request.arguments()
for p in params:
if (p != 'href') and (p != 'title'):
base += '&'+str(p).strip()+'='+self.request.get(p).strip()
href = base.strip().encode('utf-8')
```

Python is by no means my "first language" so if there if there are some mistakes please forgive me and correct them!

Thanks!