Fixed marketSearch (fixes #112)

This commit is contained in:
Alexander Corn 2016-06-27 16:56:16 -04:00
parent 17e5b94782
commit 60e0e63a92

View File

@ -27,12 +27,13 @@ SteamCommunity.prototype.marketSearch = function(options, callback) {
qs.count = 100;
qs.sort_column = 'price';
qs.sort_dir = 'asc';
performSearch.call(this, this.httpRequest, qs, [], callback);
};
function performSearch(request, qs, results, callback) {
var self = this;
request({
var results = [];
performSearch();
function performSearch() {
self.httpRequest({
"uri": "https://steamcommunity.com/market/search/render/",
"qs": qs,
"headers": {
@ -70,10 +71,11 @@ function performSearch(request, qs, results, callback) {
callback(null, results);
} else {
qs.start += body.pagesize;
performSearch.call(self, request, qs, results, callback);
performSearch();
}
}, "steamcommunity");
}
};
function CMarketSearchResult(row) {
var match = row.attr('href').match(/\/market\/listings\/(\d+)\/(.+)/);