Jump to content
McKay Development

How can i sent trade offer from php?


Recommended Posts

The way I generally do it is set up a bot in node.js using steam-tradeoffer-manager, and create a Web server in that bot which accepts commands to send trade offers. Then use curl in php to command the bot to send an offer.

 

I believe there are php libraries for interacting with Steam, but I don't personally think php is well suited for that task.

Link to comment
Share on other sites

There are many ways of doing this. One way would be to use MySQL or MongoDB to create a queue for the bot to send. This queue might contain the items to send, the SteamID of the person to send it to, and their token. Then, the bot will poll the database every X seconds to check if there's a new trade offer to send, and, if there is, send it. Websites that I've made use MongoDB to do just that.

 

Another, cleaner, and faster way to do this would be to use Socket.io to emit the trade offer to send just like above. The downside to Socket.io, however, is not having a queue which would build up while the bot is offline, or serve as a log.

 

You could also go with the straight PHP route, using waylaidwanderer's PHP-SteamCommunity.

Link to comment
Share on other sites

I'm concerned about the same thing. I've seen many sites using an ajax query to the .php file which then sends data to node.js bot (I believe).

But how can you connect to websocket in php? Don't you need to use javascript? Also, you can view website's javascript with a javascript debugger, wont people be able to manipulate the queries?

Link to comment
Share on other sites

  • 2 weeks later...

Better and faster option is create MVC app with node.js than implement it via curl or ajax into php?

If you were create a MVC app in Node then what would be the point in having PHP at all? Maybe use Apache or Nginx to serve static content or something, but it seems like PHP would be a bit useless if you were doing everything in Node anyway.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...