From 25dfa2cdd2d3186161de2d6aeb374985fc78a946 Mon Sep 17 00:00:00 2001 From: Alex Corn Date: Tue, 27 Jun 2023 04:31:25 -0400 Subject: [PATCH] Rename uri to url everywhere --- classes/CMarketItem.js | 4 ++-- classes/CMarketSearchResult.js | 2 +- components/groups.js | 30 +++++++++++++++--------------- components/market.js | 6 +++--- components/profile.js | 4 ++-- components/users.js | 28 ++++++++++++++-------------- index.js | 2 +- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/classes/CMarketItem.js b/classes/CMarketItem.js index 8dd40c5..68654c5 100644 --- a/classes/CMarketItem.js +++ b/classes/CMarketItem.js @@ -105,7 +105,7 @@ CMarketItem.prototype.updatePriceForCommodity = function(currency, callback) { } this._community.httpRequest({ - uri: 'https://steamcommunity.com/market/itemordershistogram?country=US&language=english¤cy=' + currency + '&item_nameid=' + this.commodityID, + url: 'https://steamcommunity.com/market/itemordershistogram?country=US&language=english¤cy=' + currency + '&item_nameid=' + this.commodityID, json: true }, (err, response, body) => { if (err) { @@ -148,7 +148,7 @@ CMarketItem.prototype.updatePriceForNonCommodity = function(currency, callback) } this._community.httpRequest({ - uri: 'https://steamcommunity.com/market/listings/' + + url: 'https://steamcommunity.com/market/listings/' + this._appid + '/' + encodeURIComponent(this._hashName) + '/render/?query=&start=0&count=10&country=US&language=english¤cy=' + currency, diff --git a/classes/CMarketSearchResult.js b/classes/CMarketSearchResult.js index d0f9e80..ff99954 100644 --- a/classes/CMarketSearchResult.js +++ b/classes/CMarketSearchResult.js @@ -32,7 +32,7 @@ SteamCommunity.prototype.marketSearch = function(options, callback) { let results = []; const performSearch = () => { this.httpRequest({ - uri: 'https://steamcommunity.com/market/search/render/', + url: 'https://steamcommunity.com/market/search/render/', qs: qs, headers: { referer: 'https://steamcommunity.com/market/search' diff --git a/components/groups.js b/components/groups.js index 1eac14f..098d8df 100644 --- a/components/groups.js +++ b/components/groups.js @@ -76,7 +76,7 @@ SteamCommunity.prototype.joinGroup = function(gid, callback) { } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}`, form: { action: 'join', sessionID: this.getSessionID() @@ -119,7 +119,7 @@ SteamCommunity.prototype.getAllGroupAnnouncements = function(gid, time, callback } this.httpRequest({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/rss/` + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/rss/` }, (err, response, body) => { if (err) { callback(err); @@ -175,7 +175,7 @@ SteamCommunity.prototype.postGroupAnnouncement = function(gid, headline, content } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements`, form }, (err, response, body) => { if (!callback) { @@ -192,7 +192,7 @@ SteamCommunity.prototype.editGroupAnnouncement = function(gid, aid, headline, co } let submitData = { - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements`, form: { sessionID: this.getSessionID(), gid: aid, @@ -220,7 +220,7 @@ SteamCommunity.prototype.deleteGroupAnnouncement = function(gid, aid, callback) } let submitData = { - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements/delete/${aid}?sessionID=${this.getSessionID()}` + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/announcements/delete/${aid}?sessionID=${this.getSessionID()}` }; this.httpRequestGet(submitData, (err, response, body) => { @@ -284,7 +284,7 @@ SteamCommunity.prototype.scheduleGroupEvent = function(gid, name, type, descript } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, + url: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, form }, (err, response, body) => { if (!callback) { @@ -348,7 +348,7 @@ SteamCommunity.prototype.editGroupEvent = function(gid, id, name, type, descript } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, + url: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, form }, (err, response, body) => { if (!callback) { @@ -371,7 +371,7 @@ SteamCommunity.prototype.deleteGroupEvent = function(gid, id, callback) { }; this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, + url: `https://steamcommunity.com/gid/${gid.toString()}/eventEdit`, form }, (err, response, body) => { if (!callback) { @@ -392,7 +392,7 @@ SteamCommunity.prototype.setGroupPlayerOfTheWeek = function(gid, steamID, callba } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/potwEdit`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/potwEdit`, form: { xml: 1, action: 'potw', @@ -434,7 +434,7 @@ SteamCommunity.prototype.kickGroupMember = function(gid, steamID, callback) { } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/membersManage`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/membersManage`, form: { sessionID: this.getSessionID(), action: 'kick', @@ -535,7 +535,7 @@ SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callba } let options = { - uri: `https://steamcommunity.com/comment/Clan/render/${gid.getSteamID64()}/-1/`, + url: `https://steamcommunity.com/comment/Clan/render/${gid.getSteamID64()}/-1/`, form: { start: from, count @@ -582,7 +582,7 @@ SteamCommunity.prototype.deleteGroupComment = function(gid, cid, callback) { } let options = { - uri: `https://steamcommunity.com/comment/Clan/delete/${gid.getSteamID64()}/-1/`, + url: `https://steamcommunity.com/comment/Clan/delete/${gid.getSteamID64()}/-1/`, form: { sessionid: this.getSessionID(), gidcomment: cid @@ -604,7 +604,7 @@ SteamCommunity.prototype.postGroupComment = function(gid, message, callback) { } let options = { - uri: `https://steamcommunity.com/comment/Clan/post/${gid.getSteamID64()}/-1/`, + url: `https://steamcommunity.com/comment/Clan/post/${gid.getSteamID64()}/-1/`, form: { comment: message, count: 6, @@ -668,7 +668,7 @@ SteamCommunity.prototype.respondToGroupJoinRequests = function(gid, steamIDs, ap let rgAccounts = (!Array.isArray(steamIDs) ? [steamIDs] : steamIDs).map(sid => sid.toString()); this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, form: { rgAccounts: rgAccounts, bapprove: approve ? '1' : '0', @@ -703,7 +703,7 @@ SteamCommunity.prototype.respondToAllGroupJoinRequests = function(gid, approve, } this.httpRequestPost({ - uri: `https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, + url: `https://steamcommunity.com/gid/${gid.getSteamID64()}/joinRequestsManage`, form: { bapprove: approve ? '1' : '0', json: '1', diff --git a/components/market.js b/components/market.js index 0ede87c..282bd60 100644 --- a/components/market.js +++ b/components/market.js @@ -221,7 +221,7 @@ SteamCommunity.prototype.createBoosterPack = function(appid, useUntradableGems, } this.httpRequestPost({ - uri: 'https://steamcommunity.com/tradingcards/ajaxcreatebooster/', + url: 'https://steamcommunity.com/tradingcards/ajaxcreatebooster/', form: { sessionid: this.getSessionID(), appid, @@ -267,7 +267,7 @@ SteamCommunity.prototype.createBoosterPack = function(appid, useUntradableGems, */ SteamCommunity.prototype.getGiftDetails = function(giftID, callback) { this.httpRequestPost({ - uri: `https://steamcommunity.com/gifts/${giftID}/validateunpack`, + url: `https://steamcommunity.com/gifts/${giftID}/validateunpack`, form: { sessionid: this.getSessionID() }, @@ -303,7 +303,7 @@ SteamCommunity.prototype.getGiftDetails = function(giftID, callback) { */ SteamCommunity.prototype.redeemGift = function(giftID, callback) { this.httpRequestPost({ - uri: `https://steamcommunity.com/gifts/${giftID}/unpack`, + url: `https://steamcommunity.com/gifts/${giftID}/unpack`, form: { sessionid: this.getSessionID() }, diff --git a/components/profile.js b/components/profile.js index 2cbe7a1..9aeab93 100644 --- a/components/profile.js +++ b/components/profile.js @@ -304,7 +304,7 @@ SteamCommunity.prototype.uploadAvatar = function(image, format, callback) { } this.httpRequestPost({ - uri: 'https://steamcommunity.com/actions/FileUploader', + url: 'https://steamcommunity.com/actions/FileUploader', formData: { MAX_FILE_SIZE: buffer.length, type: 'player_avatar_image', @@ -350,7 +350,7 @@ SteamCommunity.prototype.uploadAvatar = function(image, format, callback) { doUpload(image); } else if (image.match(/^https?:\/\//)) { this.httpRequestGet({ - uri: image, + url: image, encoding: null }, (err, response, body) => { if (err || response.statusCode != 200) { diff --git a/components/users.js b/components/users.js index 35b70cd..fe13db7 100644 --- a/components/users.js +++ b/components/users.js @@ -14,7 +14,7 @@ SteamCommunity.prototype.addFriend = function(userID, callback) { } this.httpRequestPost({ - uri: 'https://steamcommunity.com/actions/AddFriendAjax', + url: 'https://steamcommunity.com/actions/AddFriendAjax', form: { accept_invite: 0, sessionID: this.getSessionID(), @@ -44,7 +44,7 @@ SteamCommunity.prototype.acceptFriendRequest = function(userID, callback) { } this.httpRequestPost({ - uri: 'https://steamcommunity.com/actions/AddFriendAjax', + url: 'https://steamcommunity.com/actions/AddFriendAjax', form: { accept_invite: 1, sessionID: this.getSessionID(), @@ -65,7 +65,7 @@ SteamCommunity.prototype.removeFriend = function(userID, callback) { } this.httpRequestPost({ - uri: 'https://steamcommunity.com/actions/RemoveFriendAjax', + url: 'https://steamcommunity.com/actions/RemoveFriendAjax', form: { sessionID: this.getSessionID(), steamid: userID.toString() @@ -85,7 +85,7 @@ SteamCommunity.prototype.blockCommunication = function(userID, callback) { } this.httpRequestPost({ - uri: 'https://steamcommunity.com/actions/BlockUserAjax', + url: 'https://steamcommunity.com/actions/BlockUserAjax', form: { sessionID: this.getSessionID(), steamid: userID.toString() @@ -127,7 +127,7 @@ SteamCommunity.prototype.postUserComment = function(userID, message, callback) { } this.httpRequestPost({ - uri: `https://steamcommunity.com/comment/Profile/post/${userID.toString()}/-1`, + url: `https://steamcommunity.com/comment/Profile/post/${userID.toString()}/-1`, form: { comment: message, count: 1, @@ -163,7 +163,7 @@ SteamCommunity.prototype.deleteUserComment = function(userID, commentID, callbac } this.httpRequestPost({ - uri: `https://steamcommunity.com/comment/Profile/delete/${userID.toString()}/-1`, + url: `https://steamcommunity.com/comment/Profile/delete/${userID.toString()}/-1`, form: { gidcomment: commentID, start: 0, @@ -212,7 +212,7 @@ SteamCommunity.prototype.getUserComments = function(userID, options, callback) { }, options); this.httpRequestPost({ - uri: `https://steamcommunity.com/comment/Profile/render/${userID.toString()}/-1`, + url: `https://steamcommunity.com/comment/Profile/render/${userID.toString()}/-1`, form, json: true }, (err, response, body) => { @@ -259,7 +259,7 @@ SteamCommunity.prototype.inviteUserToGroup = function(userID, groupID, callback) } this.httpRequestPost({ - uri: 'https://steamcommunity.com/actions/GroupInvite', + url: 'https://steamcommunity.com/actions/GroupInvite', form: { group: groupID.toString(), invitee: userID.toString(), @@ -294,7 +294,7 @@ SteamCommunity.prototype.getUserAliases = function(userID, callback) { } this.httpRequestGet({ - uri: `https://steamcommunity.com/profiles/${userID.getSteamID64()}/ajaxaliases`, + url: `https://steamcommunity.com/profiles/${userID.getSteamID64()}/ajaxaliases`, json: true }, (err, response, body) => { if (err) { @@ -423,7 +423,7 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t const get = (inventory, currency, start) => { this.httpRequest({ - uri: `https://steamcommunity.com${endpoint}/inventory/json/${appID}/${contextID}`, + url: `https://steamcommunity.com${endpoint}/inventory/json/${appID}/${contextID}`, headers: { Referer: `https://steamcommunity.com${endpoint}/inventory` }, @@ -516,7 +516,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont const get = (inventory, currency, start) => { this.httpRequest({ - uri: `https://steamcommunity.com/inventory/${userID.getSteamID64()}/${appID}/${contextID}`, + url: `https://steamcommunity.com/inventory/${userID.getSteamID64()}/${appID}/${contextID}`, headers: { Referer: `https://steamcommunity.com/profiles/${userID.getSteamID64()}/inventory` }, @@ -637,7 +637,7 @@ SteamCommunity.prototype.sendImageToUser = function(userID, imageContentsBuffer, let filename = Date.now() + '_image.' + imageDetails.type; this.httpRequestPost({ - uri: 'https://steamcommunity.com/chat/beginfileupload/?l=english', + url: 'https://steamcommunity.com/chat/beginfileupload/?l=english', headers: { referer: 'https://steamcommunity.com/chat/' }, @@ -688,7 +688,7 @@ SteamCommunity.prototype.sendImageToUser = function(userID, imageContentsBuffer, }); this.httpRequest({ - uri: uploadUrl, + url: uploadUrl, method: 'PUT', headers, body: imageContentsBuffer @@ -700,7 +700,7 @@ SteamCommunity.prototype.sendImageToUser = function(userID, imageContentsBuffer, // Now we need to commit the upload this.httpRequestPost({ - uri: 'https://steamcommunity.com/chat/commitfileupload/', + url: 'https://steamcommunity.com/chat/commitfileupload/', headers: { referer: 'https://steamcommunity.com/chat/' }, diff --git a/index.js b/index.js index 42cb47a..1b45732 100644 --- a/index.js +++ b/index.js @@ -156,7 +156,7 @@ SteamCommunity.prototype.getClientLogonToken = function(callback) { return StdLib.Promises.callbackPromise(null, callback, false, async (resolve, reject) => { let {jsonBody} = await this.httpRequest({ method: 'GET', - uri: 'https://steamcommunity.com/chat/clientjstoken', + url: 'https://steamcommunity.com/chat/clientjstoken', source: 'steamcommunity' });