Compare commits

...

5 Commits

Author SHA1 Message Date
Alexander Corn
36038daa1b 2.6.0 2015-07-17 21:21:59 -04:00
Alexander Corn
12cffdd62c Added Family View status to loggedIn method callback 2015-07-17 21:19:43 -04:00
Alexander Corn
eaacef66bb Added loggedIn method 2015-07-17 21:10:08 -04:00
Alexander Corn
0ef652cbac 2.5.2 2015-07-10 16:24:59 -04:00
Alexander Corn
608377277c Sort market results by price to try to avoid duplicates 2015-07-10 16:24:42 -04:00
3 changed files with 19 additions and 1 deletions

View File

@@ -25,6 +25,8 @@ SteamCommunity.prototype.marketSearch = function(options, callback) {
qs.start = 0;
qs.count = 100;
qs.sort_column = 'price';
qs.sort_dir = 'asc';
performSearch(this.request, qs, [], callback);
};

View File

@@ -235,6 +235,22 @@ SteamCommunity.prototype.resetItemNotifications = function(callback) {
});
};
SteamCommunity.prototype.loggedIn = function(callback) {
this.request("https://steamcommunity.com/my", {"followRedirect": false}, function(err, response, body) {
if(err || (response.statusCode != 302 && response.statusCode != 403)) {
callback(err ? err.message : "HTTP error " + response.statusCode);
return;
}
if(response.statusCode == 403) {
callback(null, true, true);
return;
}
callback(null, !!response.headers.location.match(/steamcommunity\.com(\/(id|profiles)\/[^\/]+)\/?/), false);
});
};
SteamCommunity.prototype._checkCommunityError = function(html, callback) {
if(html.match(/<h1>Sorry!<\/h1>/)) {
var match = html.match(/<h3>(.+)<\/h3>/);

View File

@@ -1,6 +1,6 @@
{
"name": "steamcommunity",
"version": "2.5.1",
"version": "2.6.0",
"description": "Provides an interface for logging into and interacting with the Steam Community website",
"keywords": ["steam", "steam community"],
"homepage": "https://github.com/DoctorMcKay/node-steamcommunity",