Skip to content

Commit 65ed90a

Browse files
author
Matthew Hudson
committed
Added official support for multiple ids in API requests.
1 parent 10d15a8 commit 65ed90a

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

README.markdown

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ Please refer to the [SeatGeek Platform API](http://platform.seatgeek.com/) docum
8686

8787
## TODO
8888
* datetime: support local vs utc, and ISO 8601
89-
* multi ids in arguments
9089
* support for javascript chaining
9190

9291

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var seatgeek = require('../../seatgeek');
2+
3+
seatgeek.events({ id : [ 1282220, 1192081, 1191418 ] }, function (err, events) {
4+
if (err) return console.log(err);
5+
console.log(events);
6+
});

seatgeek.coffee

+6-9
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,17 @@ _xhr = (url, callback) ->
6969

7070
req.open 'GET', url, true
7171
req.send null
72-
72+
7373
# Build the endpoint URL by combining the base url, resource, and query string.
74-
_endpoint = (resource, options) ->
74+
_endpoint = (resource, params) ->
7575
url = 'http://api.seatgeek.com/2'
76-
77-
# Convert high-level library options to low-level SG params.
78-
params = options
79-
76+
8077
# Build the query string.
8178
query_string = []
8279
for key, value of params
83-
key = encodeURIComponent key
80+
key = encodeURIComponent key
8481
value = encodeURIComponent value
85-
query_string.push(key + '=' + value)
86-
82+
query_string.push key + '=' + value
83+
8784
return url + resource + '?' + query_string.join '&'
8885

seatgeek.js

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)