heyzap_publisher_api 0.0.1 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +9 -1
- data/heyzap_publisher_api.gemspec +1 -1
- data/lib/heyzap_publisher_api/version.rb +1 -1
- data/spec/heyzap_spec.rb +37 -41
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -6,7 +6,9 @@ Unofficial Heyzap Ruby wrapper API for game publishing on your site
|
|
6
6
|
|
7
7
|
Add this line to your gemfile
|
8
8
|
|
9
|
-
gem 'heyzap_publisher_api'
|
9
|
+
gem 'heyzap_publisher_api'
|
10
|
+
|
11
|
+
Then run bundle install
|
10
12
|
|
11
13
|
== Resources
|
12
14
|
|
@@ -35,6 +37,7 @@ HeyzapPublisherApi currently supports
|
|
35
37
|
=== Games By Category
|
36
38
|
|
37
39
|
games = @heyzap.games_by_category(:featured => true, :hot_new => true)
|
40
|
+
games[:games].first.name # => "star-fever"
|
38
41
|
|
39
42
|
=== Games By Name
|
40
43
|
|
@@ -53,4 +56,9 @@ HeyzapPublisherApi currently supports
|
|
53
56
|
categories = @heyzap.categories
|
54
57
|
categories[:categories].first # => #<HeyzapPublisherApi::Category:0x000001010de6f0 @name="featured", @display_name="Featured", @num_games=29>
|
55
58
|
categories[:categories].first.name # => "featured"
|
59
|
+
|
60
|
+
== TODO
|
61
|
+
|
62
|
+
Spec for Games By Category and Games Gallery
|
63
|
+
Implement Error Codes fallback
|
56
64
|
|
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["tm lee"]
|
9
9
|
s.email = ["tm89lee@gmail.com"]
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "https://github.com/tmlee/heyzap_publisher_api"
|
11
11
|
s.summary = "Unofficial Heyzap Ruby wrapper API for game publishing on your site."
|
12
12
|
s.description = "Unofficial Heyzap Ruby wrapper API for game publishing on your site."
|
13
13
|
|
data/spec/heyzap_spec.rb
CHANGED
@@ -6,50 +6,46 @@ describe HeyzapPublisherApi::Heyzap do
|
|
6
6
|
@heyzap = HeyzapPublisherApi::Heyzap.new(:site_key => "ueJIszJiUd", :secret_key => "YPGXEX0dsq" )
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
#
|
39
|
-
# it 'should handle when game name is not found' do
|
40
|
-
# games = @heyzap.games_by_name(["star-fever", "aaaa"])
|
41
|
-
# games[:status].should == 104
|
42
|
-
# games[:message].should == "Couldn't find game with given name."
|
43
|
-
# end
|
44
|
-
#
|
45
|
-
# it 'should return games from a category'
|
46
|
-
|
47
|
-
it 'should return games from various hot categories of gallery' do
|
48
|
-
games = @heyzap.games_by_category(:featured => true, :hot_new => true)
|
49
|
-
puts games.class
|
9
|
+
it 'should return specified number of games' do
|
10
|
+
number_of_games = 5
|
11
|
+
keyword = "car"
|
12
|
+
games = @heyzap.games_by_keyword(:keyword => keyword, :per_page => number_of_games)
|
13
|
+
games[:status].should == 200
|
14
|
+
games[:games].count.should equal 5
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should fetch star-fever game information correctly in an array' do
|
18
|
+
games = @heyzap.games_by_name(["star-fever"])
|
19
|
+
games[:status].should == 200
|
20
|
+
game = games[:games].first
|
21
|
+
game.name.should == "star-fever"
|
22
|
+
game.display_name.should == "Star Fever Agency"
|
23
|
+
game.description.should == "Experience the glam and drama of SFA! Look after wannabe actors, compete for movie roles and pick out the hottest fashion. Can you turn them into red carpet A-listers? "
|
24
|
+
game.categories.should == "Life & Style,Strategy"
|
25
|
+
game.width.should == 756
|
26
|
+
game.height.should == 480
|
27
|
+
game.thumb_100x100.should == "http://hzmedia.heyzap.com/production_thumbnail_games_star-fever_100x100.jpeg"
|
28
|
+
game.thumb_640x480.should == "http://www.heyzap.com/util/thumbnail/1014271"
|
29
|
+
game.rating.should == 2.5
|
30
|
+
game.last_updated.should == "2011-03-16T17:16:49-05:00"
|
31
|
+
game.creative_favicon.should == "http://hzmedia.heyzap.com/game_creatives/images/1420/original/HeyZap_Favicon_V1.jpg?1298937298"
|
32
|
+
game.creative_splash_banner.should == "http://hzmedia.heyzap.com/game_creatives/images/1421/original/Heyzap_FeatSplashIm_F1.jpg?1298937299"
|
33
|
+
game.creative_featured_thumbnail.should == "http://hzmedia.heyzap.com/game_creatives/images/1422/original/Heyzap_FeatSelThumb_VN2.jpg?1300311949"
|
34
|
+
game.creative_context_banner.should == "http://hzmedia.heyzap.com/game_creatives/images/1424/original/Context Banner.jpg?1298937346"
|
35
|
+
game.creative_screenshot.should == "http://hzmedia.heyzap.com/game_creatives/images/1425/original/Star-Pageopt.jpg?1298939712"
|
36
|
+
game.creative_thumbnail.should == "http://hzmedia.heyzap.com/game_creatives/images/1423/original/Heyzap_GameSelThumb_New4.jpg?1299097821"
|
37
|
+
end
|
50
38
|
|
39
|
+
it 'should handle when game name is not found' do
|
40
|
+
games = @heyzap.games_by_name(["star-fever", "aaaa"])
|
41
|
+
games[:status].should == 104
|
42
|
+
games[:message].should == "Couldn't find game with given name."
|
51
43
|
end
|
52
44
|
|
45
|
+
it 'should return games from a category'
|
46
|
+
|
47
|
+
it 'should return games from various hot categories of gallery'
|
48
|
+
|
53
49
|
|
54
50
|
|
55
51
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 11
|
9
|
+
version: 0.0.11
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- tm lee
|
@@ -59,7 +59,7 @@ files:
|
|
59
59
|
- spec/heyzap_spec.rb
|
60
60
|
- spec/spec_helper.rb
|
61
61
|
has_rdoc: true
|
62
|
-
homepage:
|
62
|
+
homepage: https://github.com/tmlee/heyzap_publisher_api
|
63
63
|
licenses: []
|
64
64
|
|
65
65
|
post_install_message:
|