Jump to content
McKay Development

McMuffinDK

Member
  • Posts

    49
  • Joined

  • Last visited

Posts posted by McMuffinDK

  1. The shorter one is used with the item's market id wich (if i got it right) is hard to get. The long one is in the tradeoffer object that is sent and therefore a lot easier to use

  2. I am trying to get my CS:GO inventory with getInventoryContents(appid, contextid, tradableOnly, callback). My full code is:

    "use strict";
    
    const SteamUser = require('steam-user');
    const SteamTotp = require('steam-totp');
    const SteamCommunity = require('steamcommunity');
    const TradeOfferManager = require('steam-tradeoffer-manager');
    
    const client = new SteamUser();
    const community = new SteamCommunity();
    const manager = new TradeOfferManager({
    	steam: client,
    	community: community,
    	language: 'en'
    });
    
    var steamLogOn = {
    	accountName: 'FancyUsername',
    	password: 'VerySecurePassword',
    	twoFactorCode: SteamTotp.generateAuthCode('Shared_Secret')
    };
    
    
    client.logOn(steamLogOn);
    
    client.on('loggedOn', () => {
    	console.log('[Steam] Logged in');
    });
    
    client.on('webSession', (sessionid, cookies) => {
    	manager.setCookies(cookies);
    	community.setCookies(cookies);
    });
    
    manager.getInventoryContents(730, 2, true, (err, inventory) => {
    	if (err) {
    		throw err;
    	} else {
    		console.log(inventory);
    	}
    });
    
    

    The error i get is:

    /var/www/bot/node_modules/steamcommunity/components/users.js:374
                            "uri": "https://steamcommunity.com/inventory/" + userID.getSteamID64() + "/" + appID + "/" + contextID,
                                                                                    ^
    
    TypeError: Cannot read property 'getSteamID64' of null
        at get (/var/www/bot/node_modules/steamcommunity/components/users.js:374:60)
        at SteamCommunity.getUserInventoryContents (/var/www/bot/node_modules/steamcommunity/components/users.js:370:2)
        at TradeOfferManager.getUserInventoryContents (/var/www/bot/node_modules/steam-tradeoffer-manager/lib/index.js:293:18)
        at TradeOfferManager.getInventoryContents (/var/www/bot/node_modules/steam-tradeoffer-manager/lib/index.js:281:7)
        at Object.<anonymous> (/var/www/bot/test.js:34:9)
        at Module._compile (module.js:660:30)
        at Object.Module._extensions..js (module.js:671:10)
        at Module.load (module.js:573:32)
        at tryModuleLoad (module.js:513:12)
        at Function.Module._load (module.js:505:3)
    
  3. I don't think so, I tried quick and it returned an error about access headers:

    Failed to load https://steamcommunity.com/market/priceoverview/?appid=730&currency=3&market_hash_name=StatTrak™%20M4A1-S%20%7C%20Hyper%20Beast%20(Minimal%20Wear): No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'example.com' is therefore not allowed access.
    

    I am working on a nodejs module to do this, so if you are interested i can tell you when it is ready to launch

  4.  

    That was a mistake, I don't fetch icon image for dota2 either.

     

    However I spent the afternoon getting what i need for CSGO.

     

    • With some regex and key/value mapping you can extract weapon / type / exterior from market name.
    • With steamlytics API method "/v1/items" you can get rarity and icon url.

     

    May i borrow your code?

×
×
  • Create New...