Giter Site home page Giter Site logo

snowskeleton / epic-games-store-crawler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donkeyco/epic-games-store-crawler

0.0 0.0 0.0 45 KB

A crawler to retrieve store data of the Epic Games store

Home Page: https://donkeyco.github.io/epic-games-store-crawler/

License: GNU General Public License v3.0

TypeScript 100.00%

epic-games-store-crawler's Introduction

epic-games-store-crawler

epic-games-store-crawler is a crawler, which retrieves data from the Epic Games Store. It's purpose is to provide easy to access methods to crawl specific store data such as current game prices, free games, categories, etc.

Installation

Install using npm

npm install epic-games-store-crawler

Install using yarn

yarn add epic-games-store-crawler

Install using source

Clone the repository
git clone https://github.com/DonkeyCo/epic-games-store-crawler.git

Install dependencies
npm install or yarn install

Run build script
npm run build or yarn run build

Use files in dist folder for coding

Usage

Import module

To use epic-games-store-crawler you have to import it: \

// with require
var egsCrawler = require('epic-games-store-crawler)';
var crawler = egsCrawler.Crawler;
// with import
import { Crawler } from 'epic-games-store-crawler';

Using module - Examples

1 - Crawling catalog items

Crawler.getItems({
    allowedCountries: 'DE',
    category: 'games/edition/base|bundle/games|editors',
    count: 30,
    country: 'DE',
    locale: 'de'
});
{
    "Catalog": {
        "searchStore":{
            "elements":[{
                "title":"Generic Game",
                "id":"3x4mpl31d",
                "namespace":"example",
                "description":"Generic Description",
                "seller": {
                    "name":"Generic"
                },
                "price": {
                    "totalPrice": {
                        "discountPrice":0,
                        "originalPrice":0,
                        "voucherDiscount":0,
                        "discount":0,
                        "currencyCode":"EUR",
                        "currencyInfo": {
                            "decimals":2
                        }
                    }
                },
                "promotions": { 
                    "promotionalOffers": [{
                        "promotionalOffers":[{
                            "startDate":"2020-08-13T15:00:00.000Z",
                            "endDate":"2020-08-20T15:00:00.000Z"
                        }]
                    }]
                }
            }]
        }
    }
}

2 - Crawling free games

Crawler.getFreeGames({
    allowCountries: 'DE',
    country: 'DE',
    locale: 'de'
});
// Returns
{
    "Catalog": {
        "searchStore":{
            "elements":[{
                "title":"Generic Game",
                "id":"3x4mpl31d",
                "namespace":"example",
                "description":"Generic Description",
                "seller": {
                    "name":"Generic"
                },
                "price": {
                    "totalPrice": {
                        "discountPrice":0,
                        "originalPrice":0,
                        "voucherDiscount":0,
                        "discount":0,
                        "currencyCode":"EUR",
                        "currencyInfo": {
                            "decimals":2
                        }
                    }
                },
                "promotions": { 
                    "promotionalOffers": [{
                        "promotionalOffers":[{
                            "startDate":"2020-08-13T15:00:00.000Z",
                            "endDate":"2020-08-20T15:00:00.000Z"
                        }]
                    }]
                }
            }]
        }
    }
}

3 - Crawling catalog tags

Crawler.getCatalogTags({
    namespace: 'epic',
    locale: 'de',
    start: 0,
    count: 999
});
// Returns
{
    "Catalog": {
        "tags": {
            "elements": [{
                "aliases": [],
                "id":"9547",
                "name":"WINDOWS",
                "referenceCount":259,
                "status":"ACTIVE"  
            }]
        }
    }
}

4 - Crawling news

Crawler.getNews('de', 30);
[{
    "jcr:isCheckedOut":true,
    "link":"/path/to/something",
    "_title":"title",
    "_noIndex":false,
    "_images_":[
        "https://example.com/image.png"
    ],"jcr:baseVersion":"abc-def-ghi",
    "_urlPattern":"/path/to/something",
    "lastModified":"2020-08-13T14:28:09.556Z",
    "_locale":"de",
    "_id":"abc-def-ghi",
    "trending":false,
    "image":"https://example.com/image.png",
    "trendingImage":"https://example.com/image.png",
    "cat":"Launcher",
    "_type":"Common Post Link",
    "sticky":false,
    "short":"Short text. Lorem Ipsum",
    "title":"Title. Lorem Ipsum",
    "date":"2020-08-13T19:00:00.000Z",
    "externalLink":"/path/to/something",
    "slug":"this-is-a-slug",
    "url":"/path/to/something",
    "urlPattern":"/path/to/something"
}]

Contribution

If you are interested in contributing, feel free to create a PR or an issue.

epic-games-store-crawler's People

Contributors

donkeyco avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.