Git Product home page Git Product logo

gogcom's Introduction

gogcom Gem Version Build Status Coverage Status

This project is not being developed anymore and probably won't until GOG comes up with official API.


Gogcom is a Ruby library for easy querying gog.com website.

Because GOG.com doesn't have official API, data is being gathered by parsing global javascript object. That means that there's no guarantee that gem will always work as expected. Do not use this in production.

Usage

Installation

gem 'gogcom', '~> 0.0.27'
bundle install

Get game info

require 'gogcom'

game = Gogcom.game(:name => "Spelunky")

game.title               # => "Spelunky"
game.genres              # => ["Action", "Adventure", "Platformer"]
game.download_size       # => "143 MB"
game.release_date        # => 1375934400 (Unix time)
game.description         # => "..."
game.price               # => "$14.99"
game.avg_rating          # => "4.6"
game.avg_ratings_count   # => 268
game.platforms           # => ["Windows"]
game.languages           # => ["English", "French", "Italian", "German", "Spanish"]
game.pegi_age             # => false
game.developer           # => "Mossmouth"
game.publisher           # => "Mossmouth"
game.bonus_content       # => [...]
game.game_modes          # => ["Single-player", "Multi-player", "Co-op"]

# Reviews right now are limited to 5 (sorted by most helpful, same as in actual website)
game.reviews.each do |review|
	review.title
	review.rating
	review.author
	review.body
end

Get games on sale

require 'gogcom'

sale = Gogcom.sale
# sale = Gogcom.sale(:type => "games")
# sale = Gogcom.sale(:type => "movies")
# sale = Gogcom.sale(:limit => 5)

sale.each do |game|
	game.title
	game.current_price
	game.original_price
	game.discount_percentage
	game.discount_amount
end

Get news

require 'gogcom'

news = Gogcom.news
# news = Gogcom.news(:limit => 3)

news.each do |post|
  post.title
  post.link
  post.body
  post.date
end

License

This code is free software; you can redistribute it and/or modify it under the terms of the zlib License. A copy of this license can be found in the included LICENSE file.

gogcom's People

Contributors

rbrs avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gogcom's Issues

Sometimes game name differs from url

Some games have differences between title and url. For example, Heroes of Might and Magic 3 Complete has URL /heroes_of_might_and_magic_3_complete_edition.

There has to be a solution to handle cases like this.

Get news

There's available rss feed http://www.gog.com/frontpage/rss. Just need to parse and display.

Better game names handling

A lot of game titles have endings like GOTY, Complete Edition, Gold, Deluxe etc. Gogcom should figure out what ending it should add when querying GoG. Best case would be if I search for ex. Gogcom.game("SimCity 2000"), it will find SimCity 2000 Deluxe Edition.

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.