项目作者: OmG3r

项目描述 :
This gem simplifes/allows sending steam trade offers programmatically.
高级语言: Ruby
项目地址: git://github.com/OmG3r/steam-trade.git
创建时间: 2018-04-21T21:30:04Z
项目社区:https://github.com/OmG3r/steam-trade

开源协议:GNU General Public License v3.0

下载


z# steam-trade V0.3.3

PLEASE IF SOMETHING DOES NOT WORK PROPERLY MAKE A GITHUB ISSUE

This gem simplifes/allows sending steam trade offers programmatically.

this gem is primarly for trading cards, tho can be used to CS:GO and other games inventories

Changelog

  1. 0.3.3:
  2. - hotfix login without api-key
  3. 0.3.2:
  4. - added send_trade_allow_request() (mobile confirmation) and confirm_all() (mobile confirmation)
  5. 0.3.1:
  6. - added cottage() , vote_2018() and sell_items()
  7. 0.3.0:
  8. - hotfix for cookie login
  9. 0.2.9:
  10. - hotfix for cookie login (remember me)
  11. 0.2.8:
  12. - fixed cookie login
  13. 0.2.7:
  14. - added salien_card() to collect steam Salien game Trading Cards
  15. 0.2.6:
  16. - hotfix
  17. 0.2.5:
  18. - added finish_queue() to collect Steam Sale Trading Cards
  19. - hotfix
  20. 0.2.4:
  21. - hotfix
  22. 0.2.3:
  23. - hotfix
  24. 0.2.2:
  25. - fixed issues with ruby 2.4+
  26. - added class methods for fa(), normal_get_inventory(), raw_get_inventory, sets_count()
  27. 0.2.1:
  28. - many many bugs fixed
  29. 0.2.0:
  30. - hotfix
  31. 0.1.9:
  32. - Handler.new() now accepts a hash contains login cookies.
  33. - get_auth_cookies() returns cookies to use for the next login
  34. 0.1.8:
  35. - hotfix
  36. 0.1.7:
  37. - hotfix
  38. 0.1.6:
  39. - hotfix
  40. 0.1.5:
  41. - added mobile_login() which allows you to send and receive steam messages
  42. - added oauth_login() uses oauth token and steamMachine cookie to login in ( you get those from mobile_login())
  43. 0.1.4:
  44. - added Social commands : send friend request, accept friend request, remove friend, send message, get messages
  45. - added function to update badges blueprint (useful when there is no gem update)
  46. 0.1.3:
  47. - decreased cooldown between requests from 2 seconds to 1 second.
  48. - added a 0.6 second wait before attempting to confirm a trade offer (mobile).
  49. - added a 3 times retry to get an inventory chunk before raising an error.
  50. - exception handling for sets_count, now no longer raises an error if the target inventory contains trading cards which are not specified in the bluepirnt.
  51. 0.1.2:
  52. - normal_get_inventory() and raw_get_inventory() now uses Mechanize instead of open-uri.
  53. - Handler.new() and fa() now accepts a time difference parameter to adjust your 2FA codes.
  54. - sets_count() now writes the txt file faster.
  55. - Mechanize session associated with the account now has a 2 second cooldown before each request to avoid spamming steam servers and resulting in a ban.

Table of content

Installation

in your commandline :

gem install steam-trade

Usage

First you need to require the gem:

  1. require 'steam-trade'

Logging-in

Handler.new()

Handler.new(username, password,shared_secret,time_difference,remember_me)

then you need to login and optionally set your shared_secret and identity_secret:

  • shared_secret is used to generate steam authentication codes so you won’t have to write them manually each time you login.
  • time_differenceis the difference between your time and steam servers, this affects how 2FA codes are generated (this MUST BE an integer)
  • remember_me is a boolean used to indicate whether you want cookies which expire shortly if set to false or stay valid for weeks if set to true
    ```ruby
    require ‘steam-trade’

account = Handler.new(‘username’,’password’,’shared_secret’) # share secret is optional
account = Handler.new(‘username’,’password’,50) #works
account = Handler.new(‘username’,’password’,’shared_secret’,50)
account = Handler.new(‘username’,’password’,50,’shared_secret’) # this will not work

account = Handler.new(‘username’,’password’,’shared_secret’,20,true) # works
account = Handler.new(‘username’,’password’,’shared_secret’,true) #works
account = Handler.new(‘username’,’password’,20,true) #works
account = Handler.new(‘username’,’password’,true) #works

account = Handler.new(‘username’,’password’,’shared_secret’,true,20) # will not work

#

account = Handler.new(‘username’) #this of course counts as non logged in

  1. keep in mind you can initialize a Handler without params however the commands you will be able to use will be limited
  2. ```ruby
  3. require 'steam-trade'
  4. account = Handler.new()
  5. puts account.fa('v3dWNq2Ncutc7RelwRVXswT8CJX=v3dWNq2Ncutc7WelwRVXswT8CJk=') => random code
Handler.new(cookies_hash,shared_secret,time_difference,remember_me)
  • cookies_hash is hash containing steamLogin, steamLoginSecure and steamMachineAuth cookies.
    this can be used with get_auth_cookies() for faster login.
  • shared_secret is used to generate steam authentication codes so you won’t have to write them manually each time you login.
  • time_differenceis the difference between your time and steam servers, this affects how 2FA codes are generated (this MUST BE an integer)
  • remember_me is a boolean used to indicate whether you want cookies which expire shortly if set to false or stay valid for weeks if set to true
  1. require 'steam-trade'
  2. account = Handler.new(JSON.parse(File.read('./creds.json'))) # creds.json is created by get_auth_cookies()
  3. account = Handler.new(JSON.parse(File.read('./creds.json')), 'shared_secret', 50)

get_auth_cookies()

  • returns the current logged in account cookies to use in the future.
    ```ruby
    require ‘steam-trade’
    account = Handler.new(‘username’,’password’,’shared_secret’,true)
    cookies = h.get_auth_cookies

File.open(‘creds.json’, ‘w’) {|f| f.puts cookies.to_json}

  1. next time :
  2. ```ruby
  3. require 'steam-trade'
  4. account = Handler.new(JSON.parse(File.read('./creds.json')))

mobile_info(identity_secret)

  • identity_secret is your account’s identity secret (try using google if you don’t know what this is).
  • identity_secret is used to automatically confirm trade offers.
    ```ruby
    require ‘steam-trade’

account = Handler.new(‘username’,’password’,’shared_secret’)
account.mobile_info(‘identity_secret’)

  1. ## Getting someone's inventory
  2. you might want to read this [guide](https://dev.doctormckay.com/topic/332-identifying-steam-items/)
  3. #### `normal_get_inventory('steamid','inventoryappid')`
  4. - `steamid` is the target's steamID, or profileID, or trade link
  5. - `inventoryappid` is the inventory type you want to load, `ex : normal inventory(the one which holds trading cards), it's is 753`
  6. - if you call `normal_get_inventory()` with no params, it will be default use the current logged-in account `steamid`, `inventoryappid = 753`
  7. ```ruby
  8. require 'steam-trade'
  9. inventory = Handler.normal_get_inventory("nomg3r")
  10. logged = Handler.new('username','password','shared_secret')
  11. logged.mobile_info('identity_secret')
  12. # while logged in
  13. my_inventory = logged.normal_get_inventory() #will get your normal inventory(753) if you are logged in else raise an exception
  14. my_inventory = logged.normal_get_inventory('730') # will get your CS:GO inventory if you are logged in else raise an exeception
  15. #whatever can be done while **not** logged in, can be of course used while logged in
  16. #while not logged in
  17. nonlogged = Handler.new()
  18. my_inventory = nonlogged.normal_get_inventory() #will raise an exception
  19. my_inventory = nonlogged.normal_get_inventory('730') #will raise an exception
  20. #whenever
  21. partner_inventory = nonlogged.normal_get_inventory('76561198044170935') #using steamid
  22. partner_inventory = nonlogged.normal_get_inventory('https://steamcommunity.com/tradeoffer/new/?partner=410155236&token=H-yK-GFt') #using trade link
  23. partner_inventory = nonlogged.normal_get_inventory('CardExchange') #using profile id
  24. partner_inventory = nonlogged.normal_get_inventory('76561198044170935',730) #will get that steamid CS:GO inventory
  25. partner_inventory = nonlogged.normal_get_inventory('https://steamcommunity.com/tradeoffer/new/?partner=410155236&token=H-yK-GFt', '730') #will get that trade link owner's CS:GO inventory
  26. partner_inventory = nonlogged.normal_get_inventory('CardExchange',730) # will get CardExchange's CS:GO inventory

the returned items from normal_get_inventory() are in the form of an array example : [item1,item2,item3...itemN].

each item is a hash which contains information about the item in the form of {"appid"=>'xxx',"contextid"=>'xxx',"assetid" => 'xxx',"classid"=> 'xxx',......"name"=> 'xxxx',"market_fee_app" => 'xxx',....}.

market_fee_app key gives you the appid of the game’s app (for trading cards), for other items technically inventoryappid is the games appid.

name key gives you the item name.

raw_get_inventory(target,inventoryappid,trimming)

IMPORTANT: this command efficiency is better than normal_get_inventory, therefore i recommend using this one.

  • target is a steamID/profileID/trade link
  • inventoryappid is the inventory type you want to load, ex : normal inventory(the one which holds trading cards), it's is 753
  • trimming, defaults to true this will remove images link and steam-server-side related informations from the descriptions hash, drastically reducing the size of data received.

This command will return a hash nearly identitical to the one received from steam the hash will have 2 keys assets and descriptions:

  • assets has an array as value, identical to steam’s (example)
  • descriptions has an array as a value identical to steam’s (example)
  1. require 'steam-trade'
  2. inv = Handler.raw_get_inventory("nomg3r")
  3. logged = Handler.new('username','password','shared_secret')
  4. inv = logged.raw_get_inventory() #works
  5. inv = logged.raw_get_inventory(false) # returns non trimmed
  6. inv = logged.raw_get_inventory(440) #works
  7. inv = logged.raw_get_inventory(76561198044170935,false) #works
  8. inv = logged.raw_get_inventory(76561198044170935,440) # works
  9. print inv['assets'] #will print all the assets
  10. print inv['descriptions'] #will print all the descriptions
  11. ### how to accurately use this
  12. class_instance = {}
  13. ## map all the items
  14. inv['descriptions'].each { |desc|
  15. identifier = desc['classid'] + '_' + desc['instanceid']
  16. class_instance[identifier] = desc
  17. }
  18. ## identify your items
  19. inv['assets'].each { |asset|
  20. identifier = asset['classid'] + '_' + asset['instanceid']
  21. puts class_instance[identifier] this will output the item's description
  22. }

set_inventory_cache()

set_inventory_cache() is:

  • a switch to locally save each inventory you get to a local file.
  • disabled by default, you need to initiate it by calling the command
  • accepts a parameter timer which defaults to timer = 120, this parameter is the difference between the save file was created and the moment it was checked (upong trying to retrieve the inventory).

  • this switch is useful if you are getting a “static” inventory or testing your code.
    ```ruby
    require ‘steam-trade’

logged = Handler.new(‘username’,’password’,’shared_secret’)
logged.mobile_info(‘identity_secret’)
logged.set_inventory_cache(150)

partner_inventory = loggedlogged.normal_get_inventory(‘CardExchange’) #this will save CardExchange’s inventory to a local file and return the inventory

partner_inventory = loggedlogged.normal_get_inventory(‘CardExchange’) # this will load the locally saved file

  1. **IMPORTANT**: `normal_get_inventory()` will load the whole target inventory, for each **5k** of items, you are adding **~40MB** to your memory and of course will affect performance of the code and the computer
  2. ## Sending a trade offer
  3. #### `send_offer(myarray,theirarray,trade_offer_link,message)`
  4. **MUST be logged in to use this command**
  5. then you can send your offer
  6. - `myarray` is an array which contains hashes of selected items to send in the offer. (currently you must get this on your own)
  7. - `Theirarray` is an array which contains hashes of selected items to receive in the offer. (currently you must get this on your own)
  8. - `trade_offer_link` can be the trade link of you partner `ex: https://steamcommunity.com/tradeoffer/new/?partner=410155236&token=H-yK-GFt`
  9. - `trade_offer_link` can be a steamID, however using a steamID requires you and your partner to be friends on steam
  10. - `trade_offer_link` can be a profileID, however using a profileID requires you and your partner to be friends on steam
  11. - `message` is the comment you want to include in the trade offer
  12. - `myarray`, `theirarray`, `trade_offer_link` are required, `message` is optional
  13. - **returns a hash which contains informations about the trade**
  14. - **identity_secret** is required for this function to work
  15. ```ruby
  16. require 'steam-trade'
  17. account = Handler.new('username','password','shared_secret')
  18. account.mobile_info('identity_secret')
  19. me = account.normal_get_inventory()
  20. his = account.normal_get_inventory("nomg3r")
  21. myarray = [me[5] , me[20] , me[60]].compact!
  22. theirarray = [his[1], his[20], his[30]].compact!
  23. # if you are friends
  24. resp = account.send_offer(myarray,theirarray,"nomg3r",message)
  25. #or (as friends)
  26. account.send_offer(myarray,theirarray,'76561198370420964',message)
  27. # whenever
  28. account.send_offer(myarray,theirarray,"https://steamcommunity.com/tradeoffer/new/?partner=410155236&token=H-yK-GFt",message)

send_trade_allow_request(tradeofferid)

  • tradeofferid is the ID of the offer you want to confirm (mobile confirmation)
  • identity_secret is required for this function to work
    ```ruby
    require ‘steam-trade’

account = Handler.new(‘username’,’password’,’shared_secret’)
account.mobile_info(‘identity_secret’)

me = account.normal_get_inventory()
his = account.normal_get_inventory(“nomg3r”)

myarray = [me[5] , me[20] , me[60]].compact!
theirarray = [his[1], his[20], his[30]].compact!

resp = account.send_offer(myarray,theirarray,”nomg3r”,message)

account.send_trade_allow_request(resp[‘tradeofferid’])

  1. #### `confirm_all()`
  2. - confirms all trades which are waiting for mobile confirmation
  3. - **identity_secret** is required for this function to work
  4. ```ruby
  5. require 'steam-trade'
  6. account = Handler.new('username','password','shared_secret')
  7. account.mobile_info('identity_secret')
  8. account.confirm_all

Handling Trade Offers

you might want to read Steam Trading API

ALL OF THE COMMANDS BELOW REQUIRE AN API_KEY

set_api_key(API_KEY)

NOTE:If you are using a logged in Handler there is no need to set the API_KEY.

  • API_KEY is your apikey, you can get that from here.
    1. require 'steam-trade'
    2. acc = Handler.new()
    3. trade_offers = acc.get_trade_offers() # will raise an exception
    4. acc.set_api_key('mykey')
    5. trade_offers = acc.get_trade_offers() # after setting an API_KEY this will succeed

    get_trade_offers(time)

  • time is the moment from which you want to get updates (explained in the example)
    this will return a hash with trade_offers_sent, trade_offers_received, descriptions as keys.
    descriptions includes the descriptions of all items returned from trade_offers_sent or trade_offers_received
  1. require 'steam-trade'
  2. logged = Handler.new('username','password','shared_secret')
  3. logged.mobile_info('identity_secret')
  4. time = '' # this is the initial check for offers so we want them all
  5. polling = Thread.new(logged) { |logged|
  6. loop do
  7. offers = logged.get_trade_offers(time)
  8. time = Time.new.to_i # we save the time of the last check
  9. next if offers['trade_offers_received'] == nil # do nothing, if there is no trades
  10. puts offers['trade_offers_received'] # puts the trades
  11. sleep(15) # make sure not to spam steam's server or they will block list your IP for a period of time therefore you can't make requests
  12. end
  13. }

get_trade_offer(tradeofferid)

gets more information about a specific trade offer

  • tradeofferid is the id of the offer you want to confirm (you can get the id using this to get the offerID

have no example how to actually use this cause get_trade_offers(time) is probably better

accept_trade_offer(tradeofferid)

  • tradeofferid is the id of the offer you want to confirm (you can get the id using this to get the offerID
    ```ruby
    require ‘steam-trade’
    logged = Handler.new(‘username’,’password’,’shared_secret’)
    logged.mobile_info(‘identity_secret’)

time = ‘’ # this is the initial check for offers so we want them all
polling = Thread.new(logged) { |logged|
loop do
offers = logged.get_trade_offers(time)
time = Time.new.to_i # we save the time of the last check
next if offers[‘trade_offers_received’] == nil # do nothing, if there is no trades
offers[‘trade_offers_received’].each { |trade|
if trade[‘accountid_other’].to_i == 83905207 ## this will accept all trade received from 83905207 (Steam32 ID)
logged.accept_trade_offer(trade[‘tradeofferid’]) # to accept the trade
end
}
sleep(15) # make sure not to spam steam’s server or they will block list your IP for a period of time therefore you can’t make requests
end
}

  1. #### `decline_trade_offer(tradeofferid)`
  2. this declines a trade offer you **RECEIVED**
  3. - `tradeofferid` is the id of the offer you want to confirm (you can get the id using [this](#get_trade_offerstime) to get the offerID
  4. ```ruby
  5. require 'steam-trade'
  6. logged = Handler.new('username','password','shared_secret')
  7. logged.mobile_info('identity_secret')
  8. time = '' # this is the initial check for offers so we want them all
  9. polling = Thread.new(logged) { |logged|
  10. loop do
  11. offers = logged.get_trade_offers(time)
  12. time = Time.new.to_i # we save the time of the last check
  13. next if offers['trade_offers_received'] == nil # do nothing, if there is no trades
  14. offers['trade_offers_received'].each { |trade| # we need to check received offers to use 'decline'
  15. if trade['accountid_other'].to_i != 83905207 ## notice the '!='
  16. logged.decline_trade_offer(trade['tradeofferid']) # decline the trade
  17. end
  18. }
  19. sleep(15) # make sure not to spam steam's server or they will block list your IP for a period of time therefore you can't make requests
  20. end
  21. }

cancel_trade_offer(tradeofferid)

this cancels a trade offer you SENT

  • tradeofferid is the id of the offer you want to confirm (you can get the id using this to get the offerID
    ```ruby
    require ‘steam-trade’
    logged = Handler.new(‘username’,’password’,’shared_secret’)
    logged.mobile_info(‘identity_secret’)

time = ‘’ # this is the initial check for offers so we want them all
polling = Thread.new(logged) { |logged|
loop do
offers = logged.get_trade_offers(time)
time = Time.new.to_i # we save the time of the last check
next if offers[‘trade_offers_sent’] == nil # do nothing, if there is no trades
offers[‘trade_offers_sent’].each { |trade| # we need to check sentoffers to use ‘cancel’
if trade[‘accountid_other’].to_i != 83905207 ## notice the ‘!=’
logged.cancel_trade_offer(trade[‘tradeofferid’]) # cancel the trade
end
}
sleep(15) # make sure not to spam steam’s server or they will block list your IP for a period of time therefore you can’t make requests
end
}

  1. ## Counting badges owned
  2. #### `sets_count(target,non_marketable)`
  3. **this command does not count foil badges (only normal trading cards)**
  4. - `target` can be a steamID, a profileID or a trade link
  5. - `non_marketable` this is a switch to count **non**-marketable trading cards(defaults to **true** if not specified)
  6. - a .txt will be created from this command to read the badges
  7. - this returns a hash `{'sets' => appsets, 'appxsets' => setsowned, 'totalsets' => numberofsets, 'totalcards' => total_non_foil, 'marketable' => true}`
  8. - `'sets'` is a hash with game appids as keys and each card and number of copies owned of each card `{'appid1' => {'card1' => 5,'card2' => 3, ... 'cardN' => Z},{'appid1' => {'card1' => 0,'card2' => 2, ... 'cardN' => K} }`
  9. - `'appxsets'` is a hash containing the number of sets available of each set `{'appid1' => 5,'appid2' => 20,...'appidN' => Z}`
  10. - `'totalsets'` is an integer equals to the number of sets owned
  11. - `'totalcards'` is an integer equals to the number of non-foil cards account for
  12. ```ruby
  13. require 'steam-trade'
  14. data = Handler.sets_count("CardExchange")
  15. logged = Handler.new('username','password','shared_secret')
  16. logged.mobile_info('identity_secret')
  17. #with login
  18. logged = account.sets_count()
  19. logged = account.sets_count(false)
  20. hash = account.sets_count('CardExchange',false)
  21. hash = account.sets_count(76561198370420964)
  22. hash = account.sets_count('https://steamcommunity.com/tradeoffer/new/?partner=410155236&token=H-yK-GFt',false)
  23. #without login
  24. nonlogged = Handler.new()
  25. logged = account.sets_count() #raise exception
  26. logged = account.sets_count(false) # raise exception
  27. hash = account.sets_count('CardExchange')
  28. hash = account.sets_count(76561198370420964)
  29. hash = account.sets_count('https://steamcommunity.com/tradeoffer/new/?partner=410155236&token=H-yK-GFt',false)

update_blueprint()

  • updates your locally saved badges blueprint
    ```ruby
    require ‘steam-trade’

handler = Handler.new

handler.update_blueprint()

  1. ## 2FA codes
  2. #### `fa(shared_secret, time_difference)`
  3. - `shared_secret` is the account's shared secret (if you don't know what is this try googling 'steam shared_secret'), defaults to the logged in account's steamid if logged in.
  4. - `time_difference` is the difference between your pc's time and steam's time (**this MUST BE an integer**)
  5. **NOTE**: using this command with a new shared_secret will not change/set the current saved shared_secret for the account
  6. ```ruby
  7. require 'steam-trade'
  8. puts Hander.fa('random_shared_secret')
  9. logged = Handler.new('username','password','inital_shared_secret')
  10. puts logged.fa() #=> random code for your account
  11. puts logged.fa('new_shared_secret') # => this will give you a random code for another account, AND will not edit your initial_shared_secret
  12. ####
  13. logged_without_shared_secret = Handler.new('username','password') # this is possible of course
  14. puts logged_without_shared_secret.fa() # this will not work
  15. puts logged_without_shared_secret.fa('shared_secret') ## will give a random code
  16. ###
  17. nonlogged = Handler.new()
  18. puts nonlogged.fa() # will not work
  19. puts logged.fa() # will give a random code

Social Commands

mobile_login('username','password','shared_secret')

  • this command will be called automatically if you attempt to use send_message() or poll_messages() without authentication
  • calling this explicitly allows you to painlessly retrieve the OAuth token and SteamMachine#{steamid} cookie to use in oauth_login()
  • this function returns a hash with oauth_token and machine as keys
    ```ruby
    require ‘steam-trade’

h = Handler.new(‘user’,’pass’,’secret’)
data = h.mobile_login() #this works are you have setted username and password
puts data ## will output with oauth token and steamMachine cookie

#

h = Handler.new()
data = h.mobile_login() # will raise an error cause there is no username or password

#

h = Handler.new()
data = h.mobile_login(‘user’,’pass’,’secret’) ## will work, you are not logged in ( talking about community) here you can’t use most of the commands (send_offer() etc) and those parameters you passed will not be setted as the Handler’s

#

h = Handler.new(‘user1’,’pass1’,’secret1’)
data = mobile_login(‘user2’,’pass2’,’secret2’) # this works but trading commands etc will be called using user1, and chat commands will be called using user2

  1. #### `oauth_login(oauth_token,SteamMachine)`
  2. - `oauth_token` and `SteamMachine` can be retrieved from `mobile_login()`
  3. ```ruby
  4. require 'steam-trade'
  5. h = Handler.new()
  6. h.oauth_login('oauth_token','SteamMachine')

send_message(target, message)

sends a message to the target

  • target can be a steamID64, tradelink, or profileID
  • message the message to send
    ```ruby
    require ‘steam-trade’

h = Handler.new(‘username’, ‘password’)
h.send_message(‘nomg3r’, “Hello, Friend”)

  1. #### `poll_messages()`
  2. gives you the messages you receieved (after mobile login is initiated (after you call send_message() or poll_messages() ) )
  3. ```ruby
  4. require 'steam-trade'
  5. h = Handler.new('username', 'password')
  6. print h.poll_messages() # will not return messages so you call at again ( only the first time in the whole program )
  7. puts ""
  8. puts "------"
  9. sleep(10) #send a message to the logged in account
  10. print h.poll_messages() # actually have messages ( if you received some in the time between the first and the second request )

ALL OF THE COMMANDS BELOW REQUIRES LOGIN

send_friend_request(target)

sends a friend request to the target

  • target can be a steamID64, tradelink, or profileID
  1. require 'steam-trade'
  2. h = Handler.new('username', 'password')
  3. h.send_friend_request('nomg3r')

accept_friend_request(target)

accepts a friend request from the target

  • target can be a steamID64, tradelink, or profileID
  1. require 'steam-trade'
  2. h = Handler.new('username', 'password')
  3. h.accept_friend_request('nomg3r')

remove_friend(target)

removes a friend

  • target can be a steamID64, tradelink, or profileID
  1. require 'steam-trade'
  2. h = Handler.new('username', 'password')
  3. h.remove_friend('nomg3r')

More commands

you can find more non-vital commands in the wiki

License

The gem is available as open source under the terms of the GNU GPLV3.