
Lonster_Monster
Member-
Posts
25 -
Joined
-
Last visited
Recent Profile Visitors
Lonster_Monster's Achievements
-
I am working on a site and want to get steam items with nodejsand express i understand how to get item inventory and i am using the get-steam-inventory npmmodule and not sure on why the backpack is not being generated in the express below is the price.js file i have for price.pug and in the pug file i call each item in items and cannot get the value of length any help would be appreciated var express = require('express'); var router = express.Router(); //var pages = require('../pages/Pages.json'); //var quality = require('../public/730/quality.json') var fs = require('fs'); var data; var steamid; var backpack; var appid = 440; const steaminventory = require('get-steam-inventory'); /* GET users listing. */ router.get('/', function(req, res, next) { // render template steamid = req.user.steamid var path = './public/json/'+steamid+'.json'; checkFile(path); res.render('price', {user: req.user, items: req.backpack}); console.log(backpack) }); function checkFile(path) { try { if (fs.statSync(path)) { fs.readFile(path,"utf8", (err, backpack) => { if (err) throw err; backpack = backpack }); } } catch(err) { steaminventory.getinventory(appid, steamid, function(err, items){ if(err) { return console.log("Error, while getting user items. Please check settings or user inventory is hidden."); } else { if (items){ fs.writeFile(path, JSON.stringify(items.raw, null, 4), { flag: 'w' }, function (err) { if (err) throw err; console.log('\x1b[32m','The file has been saved!','\x1b[0m'); }); } checkFile(path) } }) } } module.exports = router;
-
Lonster_Monster started following How to use descriptions in pricing an item , How to get Express to show backpack in nodejs , How to call Steam api with Express js and 4 others
-
Question How to call Steam api with Express js
Lonster_Monster replied to Lonster_Monster's topic in General
i actually tried using it and when it wouldnt work (i think it was didnt call the request module) and figured out how to do it with the https module and the problem i have been getting is i created a function cand when i call it to be executed it doesnt want to execute -
I have a site i am creating in nodejs based on my code in php and wandering how to call steam api json json like https://steamcommunity.com/profiles/76561198076819824/inventory/json/440/2/I know how to use Express js but i am unfamiliar with how to Call GET for JSON
-
I know the steam api doesnt have an api to send steam tradeoffers in php how can i send one by trade link? I want to have a site that u Select items to buy and it will send trade offers with those items and wandering how to do it from php with the trade offer link
-
Question Best way to call steam API for Inventory
Lonster_Monster replied to Lonster_Monster's topic in General
ok thanks i just wanted to make sure if that was correct on the link thanks alot -
What is the Best way to call steam api for steam items i have been using $id = "76561198147982809"; $query = "http://steamcommunity.com/profiles/".$id."/inventory/json/440/2/";; $json = file_get_contents($query); $data = json_decode($json, true); to get my bots inventory of course has 0 tradable items and get the failed error alot failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests is calling the http://steamcommunity.com/profiles/[steamid]/inventory/json/440/2/ the best way i am creating a website like scrap.tf for my steam bots to buy and sell items if there is a better way Please let me know i know some about the steam API but not the most about it and not sure which would be best if i use that and also if i upload my site onto my host will it do the errors alot or just when client calls the json i used?
-
Question How to have (offer) in exports
Lonster_Monster replied to Lonster_Monster's topic in node-steam-tradeoffer-manager
It will be a js file i want to make a trade logger but dont know how to call the (offer) from another file i dont know how to export it -
Question How to have (offer) in exports
Lonster_Monster replied to Lonster_Monster's topic in node-steam-tradeoffer-manager
I have the processOffer i want to export the (offer) part to another file how would i do that? -
Question How to have (offer) in exports
Lonster_Monster posted a topic in node-steam-tradeoffer-manager
I have been working on a tradelog code and i need to get the (offer) from the trade when it processes the trade i dont know the correct way to export the offer from manager.on('newOffer', (offer) => { processOffer(offer); }); -
Question How to use descriptions in pricing an item
Lonster_Monster replied to Lonster_Monster's topic in node-steamcommunity
I finally fixed the problem in var item = ourItems[i].market_name; var des = ourItems[i].descriptions; console.log(item) console.log(des) if (item == stock[item] && des == stock[item].description){ if (item == Prices[item] && des == Prices[item].description){ console.log(Prices[item].sell) } } changed the code to the code below and i think it is cool how i can call stuff like this now const filestockname = './/settings/Prices/Prices.json'; const filestock = require(filestockname); for (var i in ourItems) { var item = ourItems[i].market_name; var des = ourItems[i].description console.log(item) console.log(des) if (filestock[item]){ fs.readFile(filestockname, (err, data) => { if (err) throw err; console.log('File read'); }); filestock[item].description = des console.log('writing to ' + filestockname); fs.writeFile(filestockname, JSON.stringify(filestock, null, 2), function (err) { if (err) return console.log(err); console.log('writing to ' + filestockname); }); } } that is only for the our items side i didnt post for the their items side of the trade becaseu it is basically the same -
Question How to use descriptions in pricing an item
Lonster_Monster replied to Lonster_Monster's topic in node-steamcommunity
so say i wanted to do the code i have above, what exactly would i do i mean as an object like i am wanting Sorry if it is a noob question i am still kinda new to nodejs i have been making my own bot for about a year leanring new stuff in it -
Question How to use descriptions in pricing an item
Lonster_Monster posted a topic in node-steamcommunity
i have a genuine killer exclusive with the australium paint on it i done var item = ourItems[i].market_name; var des = ourItems[i].descriptions; console.log(item) console.log(des) if (item == stock[item] && des == stock[item].description){ if (item == Prices[item] && des == Prices[item].description){ console.log(Prices[item].sell) } } when it does the console log on item and des it shows "Genuine Killer Exclusive": [ { type: "text", value: "Paint Color: Australium Gold", color: "756b5e", app_data: "" }, { type: "text", value: "Break news, spirits and heads.", app_data: "" } ] i put the descriiption text in the stock under the item name and is the value of description like below { "Genuine Killer Exclusive": { "instock": 0, "stocklimit":1, "description": [ { "type": "text", "value": "Paint Color: Australium Gold", "color": "756b5e", "app_data": "" }, { "type": "text", "value": "Break news, spirits and heads.", "app_data": "" } ] } } the problem is with the "" around type, value, color, app_data, type, value, app_data it acts as if that is not the value but json wont work without the " " around the certain words SOLUTION: -
Question What Requires Steam API Key?
Lonster_Monster replied to Lonster_Monster's topic in node-steam-tradeoffer-manager
is that all the steam API Key is for and is it needed to make a trade offer in nodejs? i have gotten around the steam API key but wandering if it is needed for making trade offers? -
If u R Using Nodejs which is i would say U R becasue the forum is for Dr Mckays nodejs Npm packages here is a npm packge that uses bp.tf api https://www.npmjs.com/package/backpack.tf