saik0 / humblebundle-python

An unofficial library for querying Humble Bundle
MIT License
69 stars 15 forks source link

Added rudimentary store searching and model for products in the store #2

Closed yamatt closed 10 years ago

yamatt commented 10 years ago

This patch adds the ability to use the unofficial store API at https://www.humblebundle.com/store/api/humblebundle to search the store for products, or even get a list all items in the store.

It is not yet feature complete as it was purely to fill my need to get and compare the prices of products in the store. It would be possible to extend it to search based upon DRM and OS in future, and potentially even purchase products.

saik0 commented 10 years ago

Whoo! A nice clean PR, beautiful. I didn't event know there was a store api, want to merge this and bump minor release.

It's been awhile since I really looked at the project besides adjusting the model when it changes upstream. I need to make sure the requests aren't sending auth tokens that go unused in /store/api

Does the store api use the same auth mechanism as the library api? Does the store api work (even partially) without an auth token?

yamatt commented 10 years ago

That's a good point, I had meant to check the auth stuff before sending the pull request. The store api does work without the need for auth so I hadn't intended to try that scenario.

I just tested it and it seems to work fine with the auth at least at a high level. I am getting an issue with the order_list but that looks like it's down to the humble API data structure having changed which I can fix separately.

It's kind of annoying it looks like the data structure for products being returned from the order and the store seem to be quite different.

yamatt commented 10 years ago

Fixed the issue with order_list in #3

saik0 commented 10 years ago

Merged this into store branch in dc7aa19c536929f9ec89333f3385a8fc4fc25dea and added some extra fixes. Thanks.

saik0 commented 10 years ago

@yamatt The same simpleauth_sess cookie is sent to /store/api/humblebundle, so I think we can merge store into master whenever we're ready. Did you want to flesh out the StoreProduct model some more before release?

yamatt commented 10 years ago

@saik0 hey, sorry was away for the weekend. I would suggest releasing my modification as a minor improvement so that people can use it and I'll see about adding the other stuff in soon. For the moment it fulfils my needs.