crimson-digital / steambots-node-sdk

MIT License
0 stars 0 forks source link

getItems should use get instead of post method #1

Closed unek closed 8 years ago

unek commented 8 years ago

And GET params instead of sending options in the POST body.

mikeemoo commented 8 years ago

Thanks for the bug report. I have published version 0.0.7 of the SDK.

For reference, I strongly recommend using /events API endpoint (or the http stream) for getting item data instead of using /items API. If you use the events stream, you can ensure that no messages are lost because you can resume from the last event received.

When a trade is sent via the events stream in "complete" state you can consider the items to be added or removed from the bot. It's a far more reliable way of dealing with trades than working via /items.

Here's a simple example of how to use the events stream:

https://github.com/crimson-digital/demo.steambots.io/blob/master/app/server.js#L89

If streaming is not an option, you can achieve similar results by polling /events endpoint.

thanks

unek commented 8 years ago

Except I'm not dealing with trades, but needed a way to get all the items from bot's inventory.

Glad that it's fixed though.