Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing directoryRooms method so that it actually expects an options o…

…bject, and documented the skip option
  • Loading branch information...
commit 124f407a0a5e5b7880224714d5b539d76f90b10a 1 parent bc75532
Mac Angell authored
Showing with 8 additions and 7 deletions.
  1. +2 −1  README.md
  2. +4 −4 lib/bot.js
  3. +2 −2 src/bot.coffee
View
3  README.md
@@ -236,7 +236,8 @@ Get a directory of rooms.
* `limit` - The number of rooms to return
* `section_aware`
-* `sort` - What to sort by
+* `sort` - What to sort by,
+* `skip` - The number of rooms to skip
### stalk ( userId:string [, allInformation=false:bool ], callback:fn )
View
8 lib/bot.js
@@ -464,7 +464,7 @@
};
Bot.prototype.directoryRooms = function(options, callback) {
- var httpOptions, opt, query, _i, _len,
+ var httpOptions, opt, query, val,
_this = this;
if (typeof options !== 'object') {
callback = options;
@@ -472,9 +472,9 @@
}
options.client = 'web';
query = [];
- for (_i = 0, _len = options.length; _i < _len; _i++) {
- opt = options[_i];
- query.push("" + opt + "=" + (encodeURIComponent(options[opt])));
+ for (opt in options) {
+ val = options[opt];
+ query.push("" + opt + "=" + (encodeURIComponent(val)));
}
httpOptions = {
host: 'turntable.fm',
View
4 src/bot.coffee
@@ -379,8 +379,8 @@ class Bot
options.client = 'web'
query = []
- for opt in options
- query.push "#{opt}=#{encodeURIComponent(options[opt])}"
+ for opt,val of options
+ query.push "#{opt}=#{encodeURIComponent(val)}"
httpOptions =
host: 'turntable.fm'
Please sign in to comment.
Something went wrong with that request. Please try again.