- Changes to the official GOG API could make this library unusable!
- Requests to the API are generally slow(run a test with Mocha and see it yourself)
- How to install
- How to use
- Other GOGProduct class methods
In your NPM project, type:
npm install gog-product-wrapper
const { getProductById } = require("ugog-product")
//Note that getProductById returns a promise
getProductById(/*ID String here*/).then(function (product) {
//product is GOGProduct class
//GOGProduct respective methods here...
});
const { getProductById } = require("ugog-product")
//Id for X3: Terran War Pack
getProductById("1441039322").then(function (product) {
console.log(product.getTitle());
});
//Returns strings
.getTitle()
.getProductCard()
.getPurchaseLink()
.getImagesAPILink()
//API Link for acessing the images
//Returns Date object
.getReleaseDate()
//Returns dictionaries
.getAvailableLanguages()
.getAvailableSystems()
.getImages(advanced = false /*by default*/ )
/*
if advanced = false, it returns a dictionary with the following links:
background, logo and icon
if advanced = true, it returns:
background, logo, logo2x, sideBarIcon, sideBarIcon2x, menuNotificationAv, menuNotificationAv2
*/
//Returns a promise with a dictionary about prices
.getPrices(countryCode = "US" /*by default*/ )
//Return a promise with a dictionary about ratings
.getRatings()
- Install required dependencies
npm install
- Run test(it will use MochaJS)
npm run test
feel free to submit issues, request features, pull requests, etc.