It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Marvelous work! I wonder if GOG will ever allow something like a "Steam Spy" to happen? But, I guess not in the meantime, as that may be competitive information.
avatar
Yepoleb: Each gog.com page has a JavaScript variable called gogData that contains almost all of the information in raw form.
To add a bit more context (for muntdefems mostly ;), the page that is sent to you by the GOG servers in raw format does not contain all the info you'd expect it to - there are client-side javascript snippets that are parsing the gogData variable (which is sent along with the page) and generating the product page content accordingly.

A consequence of that is that it's rather difficult to parse the page HTML in order to get the data directly from the page unless you're using a browser. Parsing gogData directly is perhaps the only viable alternative for getting access to info otherwise unavailable via the RESTful APIs.
Post edited June 15, 2017 by WinterSnowfall
avatar
Yepoleb: I'm still searching for a nice way to figure out package contents, but that's definitely coming at some point. Having timestamps in seconds is actually the standard way to do it in, so that's nothing unexpected to me. JavaScript is the weird one in this case, not GOG :).
Yeah, I've not found an easy way to do it yet (there seems to be no link between the packages and their contents that I can find).

Really? All the programming languages I've used use milliseconds as far as I remember.. although thinking about it Java and JavaScript are probably the only ones I've ever needed Date objects in so maybe they are both the odd ones out.
Bookmarked! A lovely sight to behold.
Looks neat! I will be awaiting information on regional prices / other currencies.

Keep up the good work!
avatar
Yepoleb: ...
avatar
WinterSnowfall: ...
Thank you both! Yepoleb for answering my core doubt, and WinterSnowfall for the deeper explanation. :)
high rated
avatar
WinterSnowfall: Nicely done, it looks very useful indeed. And thanks for making the source code available! I find your use of sqlalchemy especially useful for my selfish purposes - I always wanted to figure out how to use it (by looking at a working example), but was too lazy to research it until I stumbled onto your project.

I'll have an in-depth look over it and may come up with some suggestions later on, that is, if you don't mind getting some feedback :).

Your RESTful API skills are probably better than mine anyway, but I've also been collecting and storing API data using python scripts for some time now, so I'm aware of several quirks and traps GOG API data can shove at you - should you find yourself wondering about anything at any point, do reach out to me, I'd be glad to help out if I can.
SQLAlchemy is one of the best designed libraries I've ever used, I'm never going back to writing regular SQL. I'd love to get some more detailed feedback, especially from someone with as much insight into the API as you. There are probably a lot of similarities between our codebases, if you want to collaborate I'm definitely up for it. Anyway, thanks for the offer to help out.

avatar
Yepoleb: I'm still searching for a nice way to figure out package contents, but that's definitely coming at some point. Having timestamps in seconds is actually the standard way to do it in, so that's nothing unexpected to me. JavaScript is the weird one in this case, not GOG :).
avatar
adaliabooks: Yeah, I've not found an easy way to do it yet (there seems to be no link between the packages and their contents that I can find).

Really? All the programming languages I've used use milliseconds as far as I remember.. although thinking about it Java and JavaScript are probably the only ones I've ever needed Date objects in so maybe they are both the odd ones out.
There is a link if you add two packages to the cart and they both contain the same game. At checkout it tells you that x already contains y, but only as a string without IDs. I could use WinterSnowfall's data to match up the titles to IDs and then manually fix up any mistakes. It's a really messy solution though and requires a proper script which I haven't gotten around to so far.

The timestamps originate from Unix and have been in seconds since 1975. Milliseconds wasn't possible because it had to fit into a 32bit integer and that would have been just around 50 days of date range. It's the default in Python, PHP, Ruby, C++, C, C# and many more, the Java languages indeed seem to be the outliers.
avatar
Yepoleb: There is a link if you add two packages to the cart and they both contain the same game. At checkout it tells you that x already contains y, but only as a string without IDs. I could use WinterSnowfall's data to match up the titles to IDs and then manually fix up any mistakes. It's a really messy solution though and requires a proper script which I haven't gotten around to so far.

The timestamps originate from Unix and have been in seconds since 1975. Milliseconds wasn't possible because it had to fit into a 32bit integer and that would have been just around 50 days of date range. It's the default in Python, PHP, Ruby, C++, C, C# and many more, the Java languages indeed seem to be the outliers.
If I'm understanding you correctly, I'm not sure that would help.
For example there are a lot of games that were unbundled a few years back and contain multiple library entries; for example Castles 1 + 2. In the catalogue it's a single game, but it has two IDs in the library.
But no other game in the catalogue would contain either of those games, so they wouldn't be detected.

Now WinterSnowfall's data may contain the IDs of the library games, but without knowing in advance which games are bundled and which bundle they belong to there is no way to connect the dots that I have found.

That would explain it, Java is where I've done most of my work requiring Dates and JavaScript is the only other language I've actually needed Dates in either. So I assumed milliseconds was actually the norm.
avatar
adaliabooks: For example there are a lot of games that were unbundled a few years back and contain multiple library entries; for example Castles 1 + 2. In the catalogue it's a single game, but it has two IDs in the library.
But no other game in the catalogue would contain either of those games, so they wouldn't be detected.
Essentially you're right, but it's not all that bleak.

While there is no direct link between the game packs and the individual game entries which are included in a pack, it may be possible to make some educated guesses (until GOG exposes an easy to use way of determining parentage for packs). The API will return both however, pack ids and individual game ids.

In the case of Castles 1 + 2, this would be the pack:
https://api.gog.com/products/1207658678?expand=downloads,expanded_dlcs,description,screenshots,videos,related_products,changelog

While these are the individual entries:
https://api.gog.com/products/1207663063?expand=downloads,expanded_dlcs,description,screenshots,videos,related_products,changelog
https://api.gog.com/products/1207663073?expand=downloads,expanded_dlcs,description,screenshots,videos,related_products,changelog

The "game_type" variable will determine if an entry is a pack, game or dlc, so with some SQL magic I might be able to put up a tentative list of packs with included content.
avatar
Yepoleb: I'm still searching for a nice way to figure out package contents, but that's definitely coming at some point.
avatar
adaliabooks: Yeah, I've not found an easy way to do it yet (there seems to be no link between the packages and their contents that I can find).
I cannot help any of you in that regard (have you tried contacting mrkgnao?), but I could send you the complete list of existing packages with the correspondence between catalog ID and library IDs. :)
Great work! And unlike GOG, it works on mobile too!
Thank You.
avatar
Yepoleb: GOG Database collects data from the store pages and Galaxy APIs and makes it accessible on a single page for each game. Currently its uses are a bit limited and mostly developer focused, but I have many ideas of features that could be useful for all players. As the name suggests, this project has been heavily inspired by Steam Database, you should definitely check them out if you're a Steam user.

Current features:
* Downloads list
* Basic API data
* Dollar price tracking

Planned features:
* Regional prices
* Store info tracking
* Non-store games
* File tracking

The site can be found at http://gogdb.yepoleb.me and is hosted on my home server, so please be gentle if it's going a bit slow.
Excellent work! I searched through a few games, everythingworked perfectly.
avatar
adaliabooks: Yeah, I've not found an easy way to do it yet (there seems to be no link between the packages and their contents that I can find).
avatar
muntdefems: I cannot help any of you in that regard (have you tried contacting mrkgnao?), but I could send you the complete list of existing packages with the correspondence between catalog ID and library IDs. :)
I've already got what MaGog has, and use it for the Legacy covers.

The problem is that mrkgnao did it manually for Magog, i.e. he used to find the IDs and associate them to the right products himself (with the help of people who had both the game in question), but he hasn't been doing that for some time.
Thankfully we don't get many bundled games, but we do get ones where the IDs don't always match for whatever reason (like the recent Bethesda games which had their IDs changed so they would include the freebies).

If I had a way of automatically determining and associating those values then I could use it for the Changelog links too (which don't work on packed games because the changelog is associated with the library ID, not the catalogue ID) as well as making the Legacy covers work better.
avatar
WinterSnowfall: The "game_type" variable will determine if an entry is a pack, game or dlc, so with some SQL magic I might be able to put up a tentative list of packs with included content.
See above.

It's not too difficult to do manually, the trick is to find a way to automate it so we don't have to, and that's where the issue arises.

I've even asked Johny about it in the past and whatever method Gog uses of giving you the right products in your library when you purchase a pack is either entirely server side or occurs by magic. Neither of which is very helpful to an endeavour like this.
Post edited June 16, 2017 by adaliabooks
avatar
adaliabooks: It's not too difficult to do manually, the trick is to find a way to automate it so we don't have to, and that's where the issue arises.

I've even asked Johny about it in the past and whatever method Gog uses of giving you the right products in your library when you purchase a pack is either entirely server side or occurs by magic. Neither of which is very helpful to an endeavour like this.
I got your point, but except for the rather obscure and impractical shopping cart checkout validation Yepoleb mentioned earlier, I don't think there is a way to fully automate this until GOG facilitates it. They most definitely have a link inside of their main product storing database, they're just not exposing it on the site or via APIs.

For now, all I can think of is that I can write an SQL query on pack ids to search for any variable-window substring (starting with the max length) of the pack title in another entry's title, list the content and then filter out the false positives manually, add/remove as necessary based on experience and my own catalog of purchased games.

That will dish out a static list Yepoleb can use for existing titles, or at least complete what MaGog is currently providing. I know it's hardly ideal, but I can't think of any other way around it as things stand right now - considering what GOG is publicly exposing... or better said not exposing.
Post edited June 16, 2017 by WinterSnowfall
+1 Yepoleb! I like, keep it up.