omg3r / steam-trade Goto Github PK
View Code? Open in Web Editor NEWThis gem simplifes/allows sending steam trade offers programmatically.
License: GNU General Public License v3.0
This gem simplifes/allows sending steam trade offers programmatically.
License: GNU General Public License v3.0
def send_offer
account = Handler.new('********','********','shared_secret')
me = account.normal_get_inventory('***************', 570)
his = account.normal_get_inventory("Skanby")
myarray = [me[5] , me[20] , me[60]].compact!
theirarray = [his[1], his[20], his[30]].compact!
# whenever
account.send_offer(myarray,theirarray,"******************************************", "send offer!")
end
When sending an offer the following error is occurring, what could it be?
what is version of ruby you use?
Post requests to steamcommunity.com like
response = @session.post('https://store.steampowered.com/login/getrsakey/', {'username' => @username}).content
in LoginExecutor.rb
do not give the expected result.
They return HTML instead of JSON which triggers JSONDecodeError
Same request sent with python requests module seems fine, but all ruby implementations seem to be fucked
Code that seems to be the problem:
require 'mechanize'
@username = "test"
@session = Mechanize.new { |a| # the session which will hold your cookies to communicate with steam
a.user_agent_alias = 'Windows Mozilla'
a.follow_meta_refresh = true
a.history_added = Proc.new {sleep 1}
# a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
}
response = @session.post('https://store.steampowered.com/login/getrsakey/', {'username' => @username})
puts response.content
Python equivalent that works as expected:
import requests
print(requests.post("https://steamcommunity.com/login/getrsakey/", params={"username": "test"}).content)
In tests performed by steam, the error is always given below, and when performing through the web interface, the sending of exchange proposal works, but it is being held back.
def send_offer
account = Handler.new(************',**********')
his = account.normal_get_inventory('Skanby', 570)
me = account.normal_get_inventory("76561199093280846", 570)
myarray = [me[8]].compact!
theirarray = [his[8]].compact!
# whenever
trade_url = "https://steamcommunity.com/tradeoffer/new/?partner=112865394&token=fhoqG7oX"
account.send_offer(myarray, theirarray, trade_url)
end
Thank you for this amazing library. Any ideas on how to fetch item wear for a particular item? Thanks!
Check pull requests for a patch
Hello,
I was trying to login with steam-trade but I received the following error:
25-07-2018 18:51:58 :: :: Handler started
NameError: undefined local variable or method `username' for #<Handler:0x00000004138040>
Did you mean? @username
from (irb):8:in `new'
from (irb):8
Any thoughts on this?
ps: the original credentials were replaced by xxxx
in the example above.
Also, I'm located in Brazil, what number should I pass as time_difference?
Thanks in advance.
I have an error
~/.gem/ruby/2.5.0/gems/steam-trade-0.2.1/lib/LoginExecutor.rb:100:in `pass_stamp': undefined method `e=' for #<OpenSSL::PKey::RSA:0x0000560706db5110> (NoMethodError)
Code of my program
require 'steam-trade'
account = Handler.new("username", "pw", "secret")
account.mobile_info('mobile')
puts account.normal_get_inventory()
Hi, could you implement the IEconService's GetTradeHistory?
Thanks in advance.
Awesome gem by the way!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.