zeke/increment.io — pull request #1 by rwdaigle (2013-03-13 00:46:06+00:00)
Title: Implement `get` as multi-get: fetching one or more URLs at a time

This PR does the following:
* Allows the `get` endpoint to receive more than one `url` query parameter.
* Fetches all submitted `url`s in a single fetch with the [Redis mget](http://redis.io/commands/mget) operation.
* **Always** returns a JSON array structure, even if only a single `url` is submitted.

This last point is important as it will require a change to how existing clients parse the response. They now need to iterate over the response JSON instead of just pulling keys out of the returned hash.

The format of the `get?url=http://zeke.sikelianos.com` response without the PR is:

```json
{
action: "redirect",
url: "http://zeke.sikelianos.com",
count: 22
}
```

With this PR it will be:

```json
[
{
action: "redirect",
url: "http://zeke.sikelianos.com",
count: 22
}
]
```

I feel this is a fair compromise in that it:
* Encourages the use of batch `get` as the default operation
* Uses a consistent JSON format independent of the cardinality of the requested `get` call.

The new API call to fetch more than one URL at a time looks like `/get?url=http://zeke.sikelianos.com&url=http://google.com`:

```js
[
{
action: "redirect",
url: "http://zeke.sikelianos.com",
count: 22
},
{
action: "redirect",
url: "http://google.com",
count: 12
}
]
```