Jump to content
McKay Development

pekinese

Member
  • Posts

    6
  • Joined

  • Last visited

pekinese's Achievements

  1. But how to get the date which is the "key", I would need to get only the first entry of each price "array". How to do so, any way without using the date, because as I've seen the first date isn't always the "current" date, isn't it?
  2. See the example above. In this case I would need to get 800.
  3. I need to get the highest price See post above.
  4. I tried to get the highest price of today for an array of items. My code until now: opskins.getPriceList(730, function(err, prices) { if (err) console.log("error!"); if(prices){ highest_price = Infinity; for (var item in prices) { if(keys.includes(item)){ //how to continue now? } } } });Any suggestions how to get only the "latest" price for each item, so I can compare and get the highest price of ALL items for only today? In the end I only need to get one value, for example for this JSON object: "item1": { "2017-07-17": {"price": 800}, "2016-07-16": {"price": 453}, "2016-07-15": {"price": 435} }, "item2": { "2017-07-17": {"price": 622}, "2016-07-16": {"price": 643}, "2016-07-15": {"price": 593} } It would return 800.
  5. Is there some way to create a newline instead of doing things like this: client.chatMessage(senderId, "firstLine"); client.chatMessage(senderId, "newline");Using this way will lead to being blocked by the rate limit very fast I think.
  6. Using the code below I'm not able to set the UI mode to desktop (3). I've commented the line out and tried if the event when a new message is received is triggered and this doesn't work too. Any idea how to fix these two problems? Code: var SteamCommunity = require('steamcommunity'); var steam = new SteamCommunity(); var SteamTotp = require('steam-totp'); var sharedSecret = ""; var logOnOptions = { 'accountName': "x", 'password': "y", 'twoFactorCode': SteamTotp.generateAuthCode(sharedSecret), }; /logs in via browser steam.login(logOnOptions, function(err, sessionID, cookies, steamguard) { if (err) { console.log("There was an error logging in! Error details: " + err.message); process.exit(1); //terminates program } else { console.log("Successfully logged in as " + logOnOptions.accountName); steam.chatLogon(); } }); //check if we're logged into steam.on('chatLoggedOn', function(){ console.log("ready to chat"); }); steam.on('chatLogOnFailed', function(){ console.log("chat failed!"); }); steam.on('friendRelationship', (steamid, relationship) => { console.log("new request!"); steam.chatMessage(steamid, 'Hello there! Thanks for adding me!'); }); steam.on('friendOrChatMessage', (senderId, text) => { console.log("received: " + text); });
×
×
  • Create New...