-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Follow Games * Unfollow Games * Follow Curators * UnFollow Curators
- Loading branch information
Showing
5 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var CuratorIds = [ | ||
33075774, | ||
40954427 | ||
] | ||
var timeBetweenEachRequest = 2000; //2sec | ||
module.exports = async function(steamClient, RequestCommunity, RequestStore, SessionID, options, callback){ | ||
for (let i = 0; i < CuratorIds.length; i++) { | ||
const clanid = CuratorIds[i]; | ||
try { | ||
await FollowCurator(RequestStore, SessionID, clanid); | ||
} catch (error) { | ||
console.log(options.accountPretty+" error Following Curator, and will be skipped, CuratorId: "+clanid); | ||
console.log(error) | ||
} | ||
await Wait(timeBetweenEachRequest); | ||
} | ||
callback(); | ||
} | ||
|
||
function FollowCurator(RequestStore, SessionID, clanid) { | ||
return new Promise(function (resolve, reject) { | ||
RequestStore.post({ | ||
url: "https://store.steampowered.com/curators/ajaxfollow", | ||
form:{ | ||
clanid: clanid, | ||
sessionid: SessionID, | ||
follow: 1 | ||
} | ||
}, function (error, response, body) { | ||
if(error){ | ||
reject(error) | ||
return; | ||
} | ||
try { | ||
var response = JSON.parse(body) | ||
if(response.success.success == 1){ | ||
resolve(); | ||
return; | ||
} | ||
} catch (error) { | ||
|
||
} | ||
reject(); | ||
}); | ||
}) | ||
} | ||
function Wait(time) { | ||
return new Promise((resolve) => { | ||
setTimeout(() => resolve(), time) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var appsToFollow = [ | ||
730, | ||
440 | ||
] | ||
var timeBetweenEachRequest = 2000; //2sec | ||
module.exports = async function(steamClient, RequestCommunity, RequestStore, SessionID, options, callback){ | ||
for (let i = 0; i < appsToFollow.length; i++) { | ||
const appId = appsToFollow[i]; | ||
try { | ||
await FollowGame(RequestStore, SessionID, appId); | ||
} catch (error) { | ||
console.log(options.accountPretty+" error Following Game, and will be skipped, appid: "+appId); | ||
console.log(error) | ||
} | ||
await Wait(timeBetweenEachRequest); | ||
} | ||
callback(); | ||
} | ||
|
||
function FollowGame(RequestStore, SessionID, appId) { | ||
return new Promise(function (resolve, reject) { | ||
RequestStore.post({ | ||
url: "https://store.steampowered.com/explore/followgame/", | ||
form:{ | ||
appid: appId, | ||
sessionid: SessionID | ||
} | ||
}, function (error, response, body) { | ||
if(error){ | ||
reject(error) | ||
return; | ||
} | ||
if(body == "true"){ | ||
resolve(); | ||
return; | ||
} | ||
reject(); | ||
}); | ||
}) | ||
} | ||
function Wait(time) { | ||
return new Promise((resolve) => { | ||
setTimeout(() => resolve(), time) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//this file look the same as "FollowCurators.js", but the request have a "follow: 0". | ||
var CuratorIds = [ | ||
33075774, | ||
40954427 | ||
] | ||
var timeBetweenEachRequest = 2000; //2sec | ||
module.exports = async function(steamClient, RequestCommunity, RequestStore, SessionID, options, callback){ | ||
for (let i = 0; i < CuratorIds.length; i++) { | ||
const clanid = CuratorIds[i]; | ||
try { | ||
await UnFollowCurator(RequestStore, SessionID, clanid); | ||
} catch (error) { | ||
console.log(options.accountPretty+" error Following Curator, and will be skipped, CuratorId: "+clanid); | ||
console.log(error) | ||
} | ||
await Wait(timeBetweenEachRequest); | ||
} | ||
callback(); | ||
} | ||
|
||
function UnFollowCurator(RequestStore, SessionID, clanid) { | ||
return new Promise(function (resolve, reject) { | ||
RequestStore.post({ | ||
url: "https://store.steampowered.com/curators/ajaxfollow", | ||
form:{ | ||
clanid: clanid, | ||
sessionid: SessionID, | ||
follow: 0 | ||
} | ||
}, function (error, response, body) { | ||
if(error){ | ||
reject(error) | ||
return; | ||
} | ||
try { | ||
var response = JSON.parse(body) | ||
if(response.success.success == 1){ | ||
resolve(); | ||
return; | ||
} | ||
} catch (error) { | ||
|
||
} | ||
reject(); | ||
}); | ||
}) | ||
} | ||
function Wait(time) { | ||
return new Promise((resolve) => { | ||
setTimeout(() => resolve(), time) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//this file look the same as "FollowGame.js", but the request have a "unfollow: 1". | ||
var appsToUnFollow = [ | ||
730, | ||
440 | ||
] | ||
var timeBetweenEachRequest = 2000; //2sec | ||
module.exports = async function(steamClient, RequestCommunity, RequestStore, SessionID, options, callback){ | ||
for (let i = 0; i < appsToUnFollow.length; i++) { | ||
const appId = appsToUnFollow[i]; | ||
try { | ||
await FollowGame(RequestStore, SessionID, appId); | ||
} catch (error) { | ||
console.log(options.accountPretty+" error Following Game, and will be skipped, appid: "+appId); | ||
console.log(error) | ||
} | ||
await Wait(timeBetweenEachRequest); | ||
} | ||
callback(); | ||
} | ||
|
||
function FollowGame(RequestStore, SessionID, appId) { | ||
return new Promise(function (resolve, reject) { | ||
RequestStore.post({ | ||
url: "https://store.steampowered.com/explore/followgame/", | ||
form:{ | ||
appid: appId, | ||
sessionid: SessionID, | ||
unfollow: 1 | ||
} | ||
}, function (error, response, body) { | ||
if(error){ | ||
reject(error) | ||
return; | ||
} | ||
if(body == "true"){ | ||
resolve(); | ||
return; | ||
} | ||
reject(); | ||
}); | ||
}) | ||
} | ||
function Wait(time) { | ||
return new Promise((resolve) => { | ||
setTimeout(() => resolve(), time) | ||
}); | ||
} |