Project

gogcom

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Provides a simple, easy-to-use interface for gog.com website.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.8
~> 10.4
~> 0.10
~> 2.9
~> 1.21

Runtime

~> 0.8
~> 1.8
 Project Readme

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.