giantbomb-api 1.5.7 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -9
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +65 -35
- data/giantbomb.gemspec +4 -2
- data/lib/giantbomb-api.rb +32 -0
- data/lib/giantbomb/resources/accessory.rb +24 -0
- data/lib/giantbomb/{character.rb → resources/character.rb} +0 -1
- data/lib/giantbomb/resources/chat.rb +22 -0
- data/lib/giantbomb/{company.rb → resources/company.rb} +0 -1
- data/lib/giantbomb/{concept.rb → resources/concept.rb} +0 -2
- data/lib/giantbomb/{franchise.rb → resources/franchise.rb} +0 -1
- data/lib/giantbomb/{game.rb → resources/game.rb} +0 -1
- data/lib/giantbomb/resources/game_rating.rb +20 -0
- data/lib/giantbomb/resources/genre.rb +24 -0
- data/lib/giantbomb/{location.rb → resources/location.rb} +0 -0
- data/lib/giantbomb/{object.rb → resources/object.rb} +1 -3
- data/lib/giantbomb/{person.rb → resources/person.rb} +0 -3
- data/lib/giantbomb/{platform.rb → resources/platform.rb} +1 -1
- data/lib/giantbomb/resources/promo.rb +24 -0
- data/lib/giantbomb/resources/rating_board.rb +25 -0
- data/lib/giantbomb/resources/region.rb +25 -0
- data/lib/giantbomb/resources/release.rb +45 -0
- data/lib/giantbomb/resources/review.rb +25 -0
- data/lib/giantbomb/resources/theme.rb +19 -0
- data/lib/giantbomb/resources/type.rb +17 -0
- data/lib/giantbomb/{user_review.rb → resources/user_review.rb} +1 -1
- data/lib/giantbomb/resources/video.rb +34 -0
- data/lib/giantbomb/resources/video_type.rb +20 -0
- data/lib/giantbomb/version.rb +6 -5
- metadata +31 -20
- data/.travis.yml +0 -5
- data/lib/giantbomb.rb +0 -25
- data/lib/giantbomb/review.rb +0 -27
- data/lib/giantbomb/video.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52610eeca9dabedc466c42a9a85310fc835e9c9b
|
4
|
+
data.tar.gz: f87e15571a661370c283f3cddc68b7cf5c60e098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8af3c9651ff661448fbc62b46e8b07e8e32997247b56255fe6bec307c70d724899a7dd8f794a7a47a9db87a57dc8710e623c2cb5be7ee744f70591a20549167b
|
7
|
+
data.tar.gz: 1bbd57d7154530ddf6fe064d1642caa5bb9c24947a901881fcf76d38a0c03ca89d89e41d9f504da1658bfe812d20e2cefe87cfecae2d221da2be70caadba083a
|
data/.gitignore
CHANGED
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/giantbomb-api.svg)](https://badge.fury.io/rb/giantbomb-api)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/pacMakaveli/giantbomb/badges/gpa.svg)](https://codeclimate.com/github/pacMakaveli/giantbomb)
|
3
|
+
[![Test Coverage](https://codeclimate.com/github/pacMakaveli/giantbomb/badges/coverage.svg)](https://codeclimate.com/github/pacMakaveli/giantbomb/coverage)
|
4
|
+
|
1
5
|
## A Ruby wrapper for the GiantBomb API
|
2
6
|
|
3
|
-
|
4
|
-
mostly everything :)
|
7
|
+
Project initially started by [intelekshual](https://github.com/intelekshual/giantbomb).
|
5
8
|
|
6
9
|
## Installation
|
7
10
|
|
8
11
|
Add this line to your application's Gemfile:
|
9
12
|
|
10
13
|
```ruby
|
11
|
-
gem 'giantbomb'
|
14
|
+
gem 'giantbomb-api', '~> 1.6.0'
|
12
15
|
```
|
13
16
|
|
14
17
|
And then execute:
|
@@ -17,7 +20,7 @@ And then execute:
|
|
17
20
|
|
18
21
|
Or install it yourself as:
|
19
22
|
|
20
|
-
$ gem install giantbomb
|
23
|
+
$ gem install giantbomb-api
|
21
24
|
|
22
25
|
In your Rails application, add your API key to:
|
23
26
|
`config/initializers/giantbomb.rb`
|
@@ -28,47 +31,76 @@ GiantBomb::Api.key('API_KEY_HERE')
|
|
28
31
|
|
29
32
|
### Resources
|
30
33
|
|
31
|
-
|
32
|
-
*
|
33
|
-
*
|
34
|
-
*
|
35
|
-
*
|
36
|
-
*
|
37
|
-
*
|
38
|
-
*
|
39
|
-
*
|
40
|
-
*
|
41
|
-
|
42
|
-
|
34
|
+
The gem comprises of all GiantBomb public resources:
|
35
|
+
* Accessory `GiantBomb::Accessory`
|
36
|
+
* Character `GiantBomb::Character`
|
37
|
+
* Chat `GiantBomb::Chat`
|
38
|
+
* Company `GiantBomb::Company`
|
39
|
+
* Concept `GiantBomb::Concept`
|
40
|
+
* Franchise `GiantBomb::Franchise`
|
41
|
+
* Game `GiantBomb::Game`
|
42
|
+
* Game Rating `GiantBomb::GameRating`
|
43
|
+
* Genre `GiantBomb::Genre`
|
44
|
+
* Location `GiantBomb::Location`
|
45
|
+
* Object `GiantBomb::Object`
|
46
|
+
* Person `GiantBomb::Person`
|
47
|
+
* Platform `GiantBomb::Platform`
|
48
|
+
* Promo `GiantBomb::Promo`
|
49
|
+
* Rating Board `GiantBomb::RatingBoard`
|
50
|
+
* Region `GiantBomb::Region`
|
51
|
+
* Release `GiantBomb::Release`
|
52
|
+
* Review `GiantBomb::Review`
|
53
|
+
* Theme `GiantBomb::Theme`
|
54
|
+
* Type `GiantBomb::Type`
|
55
|
+
* User Review `GiantBomb::UserReview`
|
56
|
+
* Video `GiantBomb::Video`
|
57
|
+
* Video Type `GiantBomb::VideoType`
|
58
|
+
|
59
|
+
All resources have inherit `#list` `#detail` and `#search`
|
43
60
|
|
44
61
|
### Usage
|
45
62
|
|
46
|
-
###### Finding a
|
63
|
+
###### Finding a Resource
|
47
64
|
|
48
65
|
``` ruby
|
49
|
-
game = GiantBomb::Game.detail(
|
50
|
-
|
51
|
-
|
52
|
-
|
66
|
+
game = GiantBomb::Game.detail(49598)
|
67
|
+
game.id => 49598
|
68
|
+
game.name => "Need for Speed"
|
69
|
+
game.deck => "Need for Speed attempts to reboot the franchise with a focus on nighttime street races, multiplayer action, police chases, and new ways for players to configure and tune their cars."
|
70
|
+
game.franchises => [{"api_detail_url"=>"http://www.giantbomb.com/api/franchise/3025-483/", "id"=>483, "name"=>"Need for Speed", "site_detail_url"=>"http://www.giantbomb.com/need-for-speed/3025-483/"}]
|
71
|
+
...
|
53
72
|
```
|
54
|
-
|
55
|
-
###### Searching for Games
|
73
|
+
###### Searching a Resource
|
56
74
|
|
57
75
|
``` ruby
|
58
76
|
search = GiantBomb::Search.new
|
59
|
-
|
60
|
-
search.
|
77
|
+
|
78
|
+
search.offset(3)
|
79
|
+
search.limit(50) # max 100
|
80
|
+
search.resources('game')
|
81
|
+
search.query('Need for Speed')
|
82
|
+
|
83
|
+
search.fetch # excute query
|
61
84
|
```
|
85
|
+
or
|
86
|
+
``` ruby
|
87
|
+
GiantBomb::Search.new().query('Need for Speed').resources('game').offset(3).fetch
|
88
|
+
```
|
89
|
+
|
90
|
+
###### Searching multiple Resources
|
62
91
|
|
63
92
|
``` ruby
|
64
|
-
|
93
|
+
GiantBomb::Search.new().query('Need for Speed').resources('game, franchise').offset(3).fetch
|
94
|
+
```
|
65
95
|
|
66
|
-
|
67
|
-
.resources('game') # determines the type of resource
|
68
|
-
.fields('name,deck') # returns only the requested resources
|
69
|
-
.offset(100) # sets the offset
|
96
|
+
###### Available filter methods
|
70
97
|
|
71
|
-
|
98
|
+
``` ruby
|
99
|
+
.limit(10) # limits the number of returned resources, max 100
|
100
|
+
.resources('game') # determines the type of resource, accepts multiple resources (eg: 'game, franchise, video')
|
101
|
+
.fields('name, deck') # returns only the requested resources
|
102
|
+
.offset(100) # sets the offset
|
103
|
+
.query('Need for Speed') # the query to search for
|
72
104
|
```
|
73
105
|
|
74
106
|
### Development
|
@@ -79,14 +111,12 @@ prompt that will allow you to experiment.
|
|
79
111
|
|
80
112
|
###### TODO
|
81
113
|
|
82
|
-
* Add all resources available from: http://www.giantbomb.com/api/documentation
|
83
|
-
* Create a proper documentation showcasing all available resources and how to use them
|
84
114
|
* Tests
|
85
115
|
|
86
116
|
### Examples
|
87
117
|
|
88
|
-
For more examples see [mygames.io](https://github.com/pacMakaveli/mygames.io)
|
89
|
-
for a live application
|
118
|
+
For more examples see [mygames.io](https://github.com/pacMakaveli/mygames.io),
|
119
|
+
[games.directory repo](https://github.com/studio51/games.directory) and [games.directory](games.directory) for a live application
|
90
120
|
|
91
121
|
## License
|
92
122
|
|
data/giantbomb.gemspec
CHANGED
@@ -11,8 +11,10 @@ Gem::Specification.new do |g|
|
|
11
11
|
g.email = ["rob@robertsays.com", "pacMakaveli90@gmail.com"]
|
12
12
|
|
13
13
|
g.homepage = "http://rubygems.org/gems/giantbomb-api"
|
14
|
-
g.summary = %q{A Ruby wrapper for the GiantBomb
|
15
|
-
g.description = %q{Provides a
|
14
|
+
g.summary = %q{A Ruby wrapper for the GiantBomb API.}
|
15
|
+
g.description = %q{Provides a complete and simple Ruby interface to communicate with the GiantBomb' API}
|
16
|
+
|
17
|
+
g.license = "MIT"
|
16
18
|
|
17
19
|
g.add_dependency("httparty")
|
18
20
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
require 'giantbomb/version'
|
5
|
+
|
6
|
+
module GiantBomb
|
7
|
+
|
8
|
+
# Core
|
9
|
+
#
|
10
|
+
['api', 'search', 'resource'].each do |inc|
|
11
|
+
require File.join(File.dirname(__FILE__), 'giantbomb', inc)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Resources
|
15
|
+
|
16
|
+
a = ['accessory']
|
17
|
+
c = ['character', 'chat', 'company', 'concept']
|
18
|
+
f = ['franchise']
|
19
|
+
g = ['game', 'game_rating', 'genre']
|
20
|
+
l = ['location']
|
21
|
+
o = ['object']
|
22
|
+
p = ['person', 'platform', 'promo']
|
23
|
+
r = ['rating_board', 'region', 'release', 'review']
|
24
|
+
t = ['theme', 'type']
|
25
|
+
u = ['user_review']
|
26
|
+
v = ['video', 'video_type']
|
27
|
+
|
28
|
+
resources = [a, c, f, g, l, o, p, r, t, u, v].flatten
|
29
|
+
resources.each do |inc|
|
30
|
+
require File.join(File.dirname(__FILE__), 'giantbomb/resources', inc)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Accessory < Resource
|
3
|
+
has_resource 'accessory', plural: 'accessories', id: '3000'
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-2
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-3
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the accessory detail resource
|
10
|
+
:date_added, # Date the accessory was added to Giant Bomb
|
11
|
+
:date_last_updated, # Date the accessory was last updated on Giant Bomb
|
12
|
+
:deck, # Brief summary of the accessory
|
13
|
+
:description, # Description of the accessory
|
14
|
+
:id, # Unique ID of the accessory
|
15
|
+
:image, # Main image of the accessory
|
16
|
+
:name, # Name of the accessory
|
17
|
+
:site_detail_url # URL pointing to the accessory on Giant Bomb
|
18
|
+
]
|
19
|
+
|
20
|
+
@@fields.each do |field|
|
21
|
+
attr_accessor field
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -28,7 +28,6 @@ module GiantBomb
|
|
28
28
|
:name, # Name of the character
|
29
29
|
:objects, # Objects related to the character
|
30
30
|
:people, # People who have worked with the character
|
31
|
-
:platforms, # Platforms having a game the character has appeared in
|
32
31
|
:real_name, # Real name of the character
|
33
32
|
:site_detail_url # URL pointing to the character on Giant Bomb
|
34
33
|
]
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Chat < Resource
|
3
|
+
has_resource 'chat', plural: 'chats', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-6
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-7
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the chat detail resource
|
10
|
+
:channel_name, # Name of the video streaming channel associated with the chat
|
11
|
+
:deck, # Brief summary of the chat
|
12
|
+
:image, # Main image of the chat
|
13
|
+
:password, # Chat password
|
14
|
+
:site_detail_url, # URL pointing to the chat on Giant Bomb
|
15
|
+
:title # Title of the chat
|
16
|
+
]
|
17
|
+
|
18
|
+
@@fields.each do |field|
|
19
|
+
attr_accessor field
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -25,7 +25,6 @@ module GiantBomb
|
|
25
25
|
:name, # Name of the concept
|
26
26
|
:objects, # Objects related to the concept
|
27
27
|
:people, # People related to the concept
|
28
|
-
:platforms, # Platforms related to the concept
|
29
28
|
:related_concepts, # Other concepts related to the concept
|
30
29
|
:site_detail_url # URL pointing to the concept on Giant Bomb
|
31
30
|
]
|
@@ -33,6 +32,5 @@ module GiantBomb
|
|
33
32
|
@@fields.each do |field|
|
34
33
|
attr_accessor field
|
35
34
|
end
|
36
|
-
|
37
35
|
end
|
38
36
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class GameRating < Resource
|
3
|
+
has_resource 'game_rating', plural: 'game_ratings', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-16
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-17
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the game_rating detail resource
|
10
|
+
:id, # Unique ID of the game_rating
|
11
|
+
:image, # Main image of the game_rating
|
12
|
+
:name, # Name of the game_rating
|
13
|
+
:rating_board # Rating board that issues this game_rating
|
14
|
+
]
|
15
|
+
|
16
|
+
@@fields.each do |field|
|
17
|
+
attr_accessor field
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Genre < Resource
|
3
|
+
has_resource 'genre', plural: 'genres', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-18
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-19
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the genre detail resource
|
10
|
+
:date_added, # Date the genre was added to Giant Bomb
|
11
|
+
:date_last_updated, # Date the genre was last updated on Giant Bomb
|
12
|
+
:deck, # Brief summary of the genre
|
13
|
+
:description, # Description of the genre
|
14
|
+
:id, # Unique ID of the genre
|
15
|
+
:image, # Main image of the genre
|
16
|
+
:site_detail_url, # Name of the genre
|
17
|
+
:name # URL pointing to the genre on Giant Bomb
|
18
|
+
]
|
19
|
+
|
20
|
+
@@fields.each do |field|
|
21
|
+
attr_accessor field
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module GiantBomb
|
2
|
-
class
|
2
|
+
class Object < Resource
|
3
3
|
has_resource 'object', plural: 'objects', id: '3055'
|
4
4
|
|
5
5
|
# http://www.giantbomb.com/api/documentation#toc-0-22
|
@@ -24,13 +24,11 @@ module GiantBomb
|
|
24
24
|
:name, # Name of the object
|
25
25
|
:objects, # Other objects related to the object
|
26
26
|
:people, # People related to the object
|
27
|
-
:platforms, # Platforms related to the object
|
28
27
|
:site_detail_url # URL pointing to the object on Giant Bomb
|
29
28
|
]
|
30
29
|
|
31
30
|
@@fields.each do |field|
|
32
31
|
attr_accessor field
|
33
32
|
end
|
34
|
-
|
35
33
|
end
|
36
34
|
end
|
@@ -10,7 +10,6 @@ module GiantBomb
|
|
10
10
|
:api_detail_url, # URL pointing to the person detail resource
|
11
11
|
:birth_date, # Date the person was born
|
12
12
|
:characters, # Characters related to the person
|
13
|
-
:companies, # Companies the person has worked with
|
14
13
|
:concepts, # Concepts related to the person
|
15
14
|
:country, # Country the person resides in
|
16
15
|
:date_added, # Date the person was added to Giant Bomb
|
@@ -29,13 +28,11 @@ module GiantBomb
|
|
29
28
|
:name, # Name of the person
|
30
29
|
:objects, # Objects related to the person
|
31
30
|
:people, # Other people related to the person
|
32
|
-
:platforms, # Platforms related to the person
|
33
31
|
:site_detail_url # URL pointing to the person on Giant Bomb
|
34
32
|
]
|
35
33
|
|
36
34
|
@@fields.each do |field|
|
37
35
|
attr_accessor field
|
38
36
|
end
|
39
|
-
|
40
37
|
end
|
41
38
|
end
|
@@ -20,7 +20,7 @@ module GiantBomb
|
|
20
20
|
:online_support, # Flag indicating whether the platform has online capabilities.
|
21
21
|
:original_price, # Initial price point of the platform.
|
22
22
|
:release_date, # Date of the platform
|
23
|
-
:site_detail_url
|
23
|
+
:site_detail_url # URL pointing to the platform on Giant Bomb.
|
24
24
|
]
|
25
25
|
|
26
26
|
@@fields.each do |field|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Promo < Resource
|
3
|
+
has_resource 'promo', plural: 'promos', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-28
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-29
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the promo detail resource
|
10
|
+
:date_added, # Date the promo was added to Giant Bomb
|
11
|
+
:deck, # Brief summary of the promo
|
12
|
+
:id, # Unique ID of the promo
|
13
|
+
:image, # Main image of the promo
|
14
|
+
:link, # The link that promo points to
|
15
|
+
:name, # Name of the promo
|
16
|
+
:resource_type, # The type of resource the promo is pointing towards
|
17
|
+
:user # Author of the promo
|
18
|
+
]
|
19
|
+
|
20
|
+
@@fields.each do |field|
|
21
|
+
attr_accessor field
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class RatingBoard < Resource
|
3
|
+
has_resource 'rating_board', plural: 'rating_boards', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-30
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-31
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the rating_board detail resource
|
10
|
+
:date_added, # Date the rating_board was added to Giant Bomb
|
11
|
+
:date_last_updated, # Date the rating_board was last updated on Giant Bomb
|
12
|
+
:deck, # Brief summary of the rating_board
|
13
|
+
:description, # Description of the rating_board
|
14
|
+
:id, # Unique ID of the rating_board
|
15
|
+
:image, # Main image of the rating_board
|
16
|
+
:name, # Name of the rating_board
|
17
|
+
:region, # Region the rating_board is responsible for
|
18
|
+
:site_detail_url # URL pointing to the rating_board on Giant Bomb
|
19
|
+
]
|
20
|
+
|
21
|
+
@@fields.each do |field|
|
22
|
+
attr_accessor field
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Region < Resource
|
3
|
+
has_resource 'region', plural: 'regions', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-32
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-33
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the region detail resource
|
10
|
+
:date_added, # Date the region was added to Giant Bomb
|
11
|
+
:date_last_updated, # Date the region was last updated on Giant Bomb
|
12
|
+
:deck, # Brief summary of the region
|
13
|
+
:description, # Description of the region
|
14
|
+
:id, # Unique ID of the region
|
15
|
+
:image, # Main image of the region
|
16
|
+
:name, # Name of the region
|
17
|
+
:rating_boards, # Region in the region
|
18
|
+
:site_detail_url # URL pointing to the region on Giant Bomb
|
19
|
+
]
|
20
|
+
|
21
|
+
@@fields.each do |field|
|
22
|
+
attr_accessor field
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Release < Resource
|
3
|
+
has_resource 'release', plural: 'releases', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-34
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-35
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the release detail resource
|
10
|
+
:date_added, # Date the release was added to Giant Bomb
|
11
|
+
:date_last_updated, # Date the release was last updated on Giant Bomb
|
12
|
+
:deck, # Brief summary of the release
|
13
|
+
:description, # Description of the release
|
14
|
+
:developers, # Companies who developed the release
|
15
|
+
:expected_release_day, # Expected day the release will be released. The month is represented numerically. Combine with 'expected_release_month', 'expected_release_year' and 'expected_release_quarter' for Giant Bomb's best guess release date of the release. These fields will be empty if the 'release_date' field is set
|
16
|
+
:expected_release_month , # Expected month the release will be released. The month is represented numerically. Combine with 'expected_release_day', expected_release_quarter' and 'expected_release_year' for Giant Bomb's best guess release date of the release. These fields will be empty if the 'release_date' field is set
|
17
|
+
:expected_release_quarter, # Expected quarter release will be released. The quarter is represented numerically, where 1 = Q1, 2 = Q2, 3 = Q3, and 4 = Q4. Combine with 'expected_release_day', 'expected_release_month' and 'expected_release_year' for Giant Bomb's best guess release date of the release. These fields will be empty if the 'release_date' field is set
|
18
|
+
:expected_release_year, # Expected year release will be released. Combine with 'expected_release_day', 'expected_release_month' and 'expected_release_quarter' for Giant Bomb's best guess release date of the game. These fields will be empty if the 'release_date' field is set
|
19
|
+
:game, # Game the release is for
|
20
|
+
:game_rating, # Rating of the release
|
21
|
+
:id, # Unique ID of the release
|
22
|
+
:image, # Main image of the release
|
23
|
+
:images, # List of images associated to the release
|
24
|
+
:maximum_players, # Maximum player
|
25
|
+
:minimum_players, # Minimum player
|
26
|
+
:multiplayer_features, # Multiplayer feature
|
27
|
+
:name, # Name of the release
|
28
|
+
:platform, # Platform of the release
|
29
|
+
:product_code_type, # The type of product code the release has (ex. UPC/A, ISBN-10, EAN-13)
|
30
|
+
:product_code_value, # The release's product code
|
31
|
+
:publishers, # Companies who published the release
|
32
|
+
:region, # Region the release is responsible for
|
33
|
+
:release_date, # Date of the release
|
34
|
+
:resolutions, # Resolutions availabl
|
35
|
+
:singleplayer_features, # Singleplayer feature
|
36
|
+
:sound_systems, # Sound system
|
37
|
+
:site_detail_url, # URL pointing to the release on Giant Bomb
|
38
|
+
:widescreen_support # Widescreen support
|
39
|
+
]
|
40
|
+
|
41
|
+
@@fields.each do |field|
|
42
|
+
attr_accessor field
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Review < Resource
|
3
|
+
has_resource 'review', plural: 'reviews', id: '1900'
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-36
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-37
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the review detail resource
|
10
|
+
:deck, # Brief summary of the review
|
11
|
+
:description, # Description of the review
|
12
|
+
:dlc_name, # Name of the Downloadable Content package
|
13
|
+
:game, # Game the review is for
|
14
|
+
:publish_date, # Date the review was published on Giant Bomb
|
15
|
+
:release, # Release of game for review
|
16
|
+
:reviewer, # Name of the review's author
|
17
|
+
:score, # The score given to the game on a scale of 1 to 5
|
18
|
+
:site_detail_url # URL pointing to the review on Giant Bomb
|
19
|
+
]
|
20
|
+
|
21
|
+
@@fields.each do |field|
|
22
|
+
attr_accessor field
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Theme < Resource
|
3
|
+
has_resource 'theme', plural: 'themes', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-39
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-40
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the theme detail resource
|
10
|
+
:id, # Unique ID of the theme
|
11
|
+
:name, # Name of the theme
|
12
|
+
:site_detail_url # URL pointing to the theme on Giant Bomb
|
13
|
+
]
|
14
|
+
|
15
|
+
@@fields.each do |field|
|
16
|
+
attr_accessor field
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class Type < Resource
|
3
|
+
has_resource 'types', plural: nil, id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-41
|
6
|
+
#
|
7
|
+
@@fields = [
|
8
|
+
:detail_resource_name, # The name of the type's detail resource
|
9
|
+
:id, # Unique ID of the type
|
10
|
+
:list_resource_name # The name of the type's list resource
|
11
|
+
]
|
12
|
+
|
13
|
+
@@fields.each do |field|
|
14
|
+
attr_accessor field
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -14,7 +14,7 @@ module GiantBomb
|
|
14
14
|
:game, # Game the user_review is for
|
15
15
|
:reviewer, # Name of the review's author
|
16
16
|
:score, # The score given to the game on a scale of 1 to 5
|
17
|
-
:site_detail_url
|
17
|
+
:site_detail_url # URL pointing to the user_review on Giant Bomb
|
18
18
|
]
|
19
19
|
|
20
20
|
@@fields.each do |field|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# [hd_url, high_url, low_url] = This URLs will not be usable from a web-browser.
|
2
|
+
# You must use GiantBomb' embed player to play their videos on any other web site. See embed_player below.
|
3
|
+
# For apps you must have a registered User Agent to load and play their videos. Contact edgework@giantbomb.com to do that
|
4
|
+
|
5
|
+
module GiantBomb
|
6
|
+
class Video < Resource
|
7
|
+
has_resource 'video', plural: 'videos', id: '2300'
|
8
|
+
|
9
|
+
# http://www.giantbomb.com/api/documentation#toc-0-44
|
10
|
+
# http://www.giantbomb.com/api/documentation#toc-0-45
|
11
|
+
#
|
12
|
+
@@fields = [
|
13
|
+
:api_detail_url, # URL pointing to the video detail resource
|
14
|
+
:deck, # Brief summary of the video
|
15
|
+
:hd_url, # URL to the HD version of the video
|
16
|
+
:high_url, # URL to the High Res version of the video
|
17
|
+
:low_url, # URL to the Low Res version of the video
|
18
|
+
:embed_player, # URL for video embed player. To be inserted into an iFrame. You can add ?autoplay=true to auto-play. See http://www.giantbomb.com/api/video-embed-sample/ for more information on using the embed player.
|
19
|
+
:id, # Unique ID of the video
|
20
|
+
:image, # Image associated with the video
|
21
|
+
:length_seconds, # Length (in seconds) of the video
|
22
|
+
:name, # Title of the video
|
23
|
+
:publish_date, # Date the video was published on Giant Bomb
|
24
|
+
:site_detail_url, # URL pointing to the video on Giant Bomb
|
25
|
+
:url, # The video's filename
|
26
|
+
:user, # Author of the video
|
27
|
+
:youtube_id # Youtube ID for the video
|
28
|
+
]
|
29
|
+
|
30
|
+
@@fields.each do |field|
|
31
|
+
attr_accessor field
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module GiantBomb
|
2
|
+
class VideoType < Resource
|
3
|
+
has_resource 'video_type', plural: 'video_types', id: nil
|
4
|
+
|
5
|
+
# http://www.giantbomb.com/api/documentation#toc-0-46
|
6
|
+
# http://www.giantbomb.com/api/documentation#toc-0-47
|
7
|
+
#
|
8
|
+
@@fields = [
|
9
|
+
:api_detail_url, # URL pointing to the video_type detail resource.
|
10
|
+
:deck, # Brief summary of the video_type.
|
11
|
+
:id, # Unique ID of the video_type.
|
12
|
+
:name, # Name of the video_type.
|
13
|
+
:site_detail_url # URL pointing to the video_type on Giant Bomb.
|
14
|
+
]
|
15
|
+
|
16
|
+
@@fields.each do |field|
|
17
|
+
attr_accessor field
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/giantbomb/version.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module GiantBomb
|
2
|
-
VERSION = "1.
|
2
|
+
VERSION = "1.6.0"
|
3
3
|
|
4
4
|
# Changelog
|
5
5
|
#
|
6
|
-
# v1.5.5
|
7
|
-
# v1.5.6
|
8
|
-
# v1.5.7
|
9
|
-
|
6
|
+
# v1.5.5 - ... see git history
|
7
|
+
# v1.5.6 - Add Review resource
|
8
|
+
# v1.5.7 - Add User Review Resource
|
9
|
+
# v1.5.19 - Add all the missing resources from GB' API +1 for each resource
|
10
|
+
# v1.6.0 - GEM Rename and some cleanup here and there
|
10
11
|
#
|
11
12
|
|
12
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: giantbomb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Coker
|
@@ -25,8 +25,8 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
|
-
description: Provides a
|
29
|
-
|
28
|
+
description: Provides a complete and simple Ruby interface to communicate with the
|
29
|
+
GiantBomb' API
|
30
30
|
email:
|
31
31
|
- rob@robertsays.com
|
32
32
|
- pacMakaveli90@gmail.com
|
@@ -38,36 +38,47 @@ extra_rdoc_files: []
|
|
38
38
|
files:
|
39
39
|
- ".gitignore"
|
40
40
|
- ".rspec"
|
41
|
-
- ".travis.yml"
|
42
41
|
- Gemfile
|
43
42
|
- Gemfile.lock
|
44
|
-
- LICENSE
|
43
|
+
- LICENSE
|
45
44
|
- README.md
|
46
45
|
- Rakefile
|
47
46
|
- bin/console
|
48
47
|
- bin/setup
|
49
48
|
- giantbomb.gemspec
|
50
|
-
- lib/giantbomb.rb
|
49
|
+
- lib/giantbomb-api.rb
|
51
50
|
- lib/giantbomb/api.rb
|
52
|
-
- lib/giantbomb/character.rb
|
53
|
-
- lib/giantbomb/company.rb
|
54
|
-
- lib/giantbomb/concept.rb
|
55
|
-
- lib/giantbomb/franchise.rb
|
56
|
-
- lib/giantbomb/game.rb
|
57
|
-
- lib/giantbomb/location.rb
|
58
|
-
- lib/giantbomb/object.rb
|
59
|
-
- lib/giantbomb/person.rb
|
60
|
-
- lib/giantbomb/platform.rb
|
61
51
|
- lib/giantbomb/resource.rb
|
62
|
-
- lib/giantbomb/
|
52
|
+
- lib/giantbomb/resources/accessory.rb
|
53
|
+
- lib/giantbomb/resources/character.rb
|
54
|
+
- lib/giantbomb/resources/chat.rb
|
55
|
+
- lib/giantbomb/resources/company.rb
|
56
|
+
- lib/giantbomb/resources/concept.rb
|
57
|
+
- lib/giantbomb/resources/franchise.rb
|
58
|
+
- lib/giantbomb/resources/game.rb
|
59
|
+
- lib/giantbomb/resources/game_rating.rb
|
60
|
+
- lib/giantbomb/resources/genre.rb
|
61
|
+
- lib/giantbomb/resources/location.rb
|
62
|
+
- lib/giantbomb/resources/object.rb
|
63
|
+
- lib/giantbomb/resources/person.rb
|
64
|
+
- lib/giantbomb/resources/platform.rb
|
65
|
+
- lib/giantbomb/resources/promo.rb
|
66
|
+
- lib/giantbomb/resources/rating_board.rb
|
67
|
+
- lib/giantbomb/resources/region.rb
|
68
|
+
- lib/giantbomb/resources/release.rb
|
69
|
+
- lib/giantbomb/resources/review.rb
|
70
|
+
- lib/giantbomb/resources/theme.rb
|
71
|
+
- lib/giantbomb/resources/type.rb
|
72
|
+
- lib/giantbomb/resources/user_review.rb
|
73
|
+
- lib/giantbomb/resources/video.rb
|
74
|
+
- lib/giantbomb/resources/video_type.rb
|
63
75
|
- lib/giantbomb/search.rb
|
64
|
-
- lib/giantbomb/user_review.rb
|
65
76
|
- lib/giantbomb/version.rb
|
66
|
-
- lib/giantbomb/video.rb
|
67
77
|
- spec/giantbomb_spec.rb
|
68
78
|
- spec/spec_helper.rb
|
69
79
|
homepage: http://rubygems.org/gems/giantbomb-api
|
70
|
-
licenses:
|
80
|
+
licenses:
|
81
|
+
- MIT
|
71
82
|
metadata: {}
|
72
83
|
post_install_message:
|
73
84
|
rdoc_options: []
|
@@ -88,7 +99,7 @@ rubyforge_project:
|
|
88
99
|
rubygems_version: 2.4.8
|
89
100
|
signing_key:
|
90
101
|
specification_version: 4
|
91
|
-
summary: A Ruby wrapper for the GiantBomb
|
102
|
+
summary: A Ruby wrapper for the GiantBomb API.
|
92
103
|
test_files:
|
93
104
|
- spec/giantbomb_spec.rb
|
94
105
|
- spec/spec_helper.rb
|
data/.travis.yml
DELETED
data/lib/giantbomb.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'httparty'
|
3
|
-
|
4
|
-
require 'giantbomb/version'
|
5
|
-
|
6
|
-
module GiantBomb
|
7
|
-
|
8
|
-
['api', 'search', 'resource'].each do |inc|
|
9
|
-
require File.join(File.dirname(__FILE__), 'giantbomb', inc)
|
10
|
-
end
|
11
|
-
|
12
|
-
c = ['character', 'company', 'concept']
|
13
|
-
f = ['franchise']
|
14
|
-
g = ['game']
|
15
|
-
l = ['location']
|
16
|
-
o = ['object']
|
17
|
-
p = ['person', 'platform']
|
18
|
-
r = ['review']
|
19
|
-
u = ['user_review']
|
20
|
-
v = ['video']
|
21
|
-
|
22
|
-
[c, f, g, l, o, p, r, u, v].flatten.each do |inc|
|
23
|
-
require File.join(File.dirname(__FILE__), 'giantbomb', inc)
|
24
|
-
end
|
25
|
-
end
|
data/lib/giantbomb/review.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
module GiantBomb
|
2
|
-
class Review < Resource
|
3
|
-
has_resource 'review', plural: 'reviews', id: '1900'
|
4
|
-
|
5
|
-
# http://www.giantbomb.com/api/documentation#toc-0-36
|
6
|
-
# http://www.giantbomb.com/api/documentation#toc-0-37
|
7
|
-
#
|
8
|
-
@@fields = [
|
9
|
-
:api_detail_url, # URL pointing to the review detail resource
|
10
|
-
:deck, # Brief summary of the review
|
11
|
-
:description, # Description of the review
|
12
|
-
:dlc, # Date the franchise was added to Giant Bomb
|
13
|
-
:dlc_name, # Name of the Downloadable Content package
|
14
|
-
:game, # Game the review is for
|
15
|
-
:publish_date, # Date the review was published on Giant Bomb
|
16
|
-
:release, # Release of game for review
|
17
|
-
:reviewer, # Name of the review's author
|
18
|
-
:score, # The score given to the game on a scale of 1 to 5
|
19
|
-
:site_detail_url, # URL pointing to the review on Giant Bomb
|
20
|
-
:platforms, # Platforms the review appeared in.
|
21
|
-
]
|
22
|
-
|
23
|
-
@@fields.each do |field|
|
24
|
-
attr_accessor field
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/lib/giantbomb/video.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module GiantBomb
|
2
|
-
class Video < Resource
|
3
|
-
has_resource 'video', plural: 'videos', id: '2300'
|
4
|
-
|
5
|
-
# http://www.giantbomb.com/api/documentation#toc-0-44
|
6
|
-
#
|
7
|
-
@@fields = [
|
8
|
-
:api_detail_url, # URL pointing to the video detail resource
|
9
|
-
:deck, # Brief summary of the video
|
10
|
-
:id, # Unique ID of the video
|
11
|
-
:image, # Image associated with the video
|
12
|
-
:name, # Title of the video
|
13
|
-
:publish_date, # Date the video was published on Giant Bomb
|
14
|
-
:site_detail_url, # URL pointing to the video on Giant Bomb
|
15
|
-
:url, # The video's filename
|
16
|
-
:user # Author of the video
|
17
|
-
]
|
18
|
-
|
19
|
-
@@fields.each do |field|
|
20
|
-
attr_accessor field
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|