Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hdk101/unnoficial-gog-product-wrapper
An wrapper for GOG API for retrieving and managing products data
https://github.com/hdk101/unnoficial-gog-product-wrapper
api backend gog javascript nodejs product unnoficial wrapper
Last synced: 1 day ago
JSON representation
An wrapper for GOG API for retrieving and managing products data
- Host: GitHub
- URL: https://github.com/hdk101/unnoficial-gog-product-wrapper
- Owner: HDK101
- License: mit
- Created: 2020-06-01T21:32:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T20:31:35.000Z (about 2 years ago)
- Last Synced: 2024-12-20T11:47:07.683Z (26 days ago)
- Topics: api, backend, gog, javascript, nodejs, product, unnoficial, wrapper
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Unnoficial GOG Product Wrapper
### An wrapper for GOG API for retrieving and managing products data[![Build Status](https://travis-ci.com/HDK101/unnoficial-gog-product-wrapper.svg?branch=master)](https://travis-ci.com/HDK101/unnoficial-gog-product-wrapper)![NPM](https://img.shields.io/npm/l/ugog-product)
![npm](https://img.shields.io/npm/v/ugog-product)## Warning!
1. Changes to the official GOG API could make this library unusable!
2. Requests to the API are generally slow(run a test with Mocha and see it yourself)## Content
1. How to install
2. How to use
3. Other GOGProduct class methods## 1. How to install
In your NPM project, type:```
npm install gog-product-wrapper
```## 2. How to use
### Example 1
```javascript
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...
});```
### Example 2
```javascript
const { getProductById } = require("ugog-product")//Id for X3: Terran War Pack
getProductById("1441039322").then(function (product) {
console.log(product.getTitle());
});```
## 3. Other methods
### Example 1```javascript
//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()```
## Some steps to run the source code
1. Install required dependencies
```
npm install
```2. Run test(it will use MochaJS)
```
npm run test
```### Contributing
feel free to submit issues, request features, pull requests, etc.