kickscraper 0.2.3 → 0.2.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +2 -2
- data/lib/kickscraper/client.rb +1 -1
- data/lib/kickscraper/version.rb +1 -1
- data/spec/no_email_password_client_spec.rb +9 -9
- data/spec/no_email_password_project_spec.rb +8 -10
- data/spec/support/shared_examples.rb +2 -2
- data/spec/test_constants.rb +1 -1
- data/spec/user_spec.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03e4db70e1b4f0ce03c95bb1e9d56d5e83398d78
|
4
|
+
data.tar.gz: 24327f4bcb01a94c8dec8f759b22d56696447589
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acb81ad4b9c266ebd606118682d6af5dea68c7f0efaeedd35b597e42013b6df89241d4d001e13efb0d942b2afa9c5364d93db5b68ba94435a5aed34f6af5b148
|
7
|
+
data.tar.gz: 50086414c8ca617e5b8f501df6110067aa4b3b2142e98311de2829922719acd174c99235d1bc8ddcbbc83de9a47e43521c2bf3b3cdf57d0766e18a054ccd8306
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
### 0.2.4
|
2
|
+
|
3
|
+
* bug fixes
|
4
|
+
* Changing the math for determining if there are more projects available for a given search (because Kickstarter is currently returning 12 projects instead of 20)
|
5
|
+
|
6
|
+
### 0.2.3
|
7
|
+
|
8
|
+
* bug fixes
|
9
|
+
* Adding CLIENT_ID parameter to Kickstarter api calls that now require it
|
10
|
+
|
11
|
+
### 0.2.2
|
12
|
+
|
13
|
+
* enhancements
|
14
|
+
* Allowing projects to be searched within categories and states
|
15
|
+
|
16
|
+
### 0.2.1
|
17
|
+
|
18
|
+
* bug fixes
|
19
|
+
* Sending JSON content-type in all API calls
|
20
|
+
|
1
21
|
### 0.2.0
|
2
22
|
|
3
23
|
* Changing the minor version because we've rewritten several things to accommodate Kickstarter's change to public search
|
data/README.md
CHANGED
@@ -115,10 +115,10 @@ Provided with your user credentials this will list the first 20 or so projects y
|
|
115
115
|
}
|
116
116
|
|
117
117
|
# Get info about Kickstarter categories or find projects by category
|
118
|
-
|
118
|
+
c.categories
|
119
119
|
=> [<Category: 'Art'>, <Category: 'Conceptual Art'>, <Category: 'Crafts'>, <Category: 'Animation'>, <Category: 'Tabletop Games'>, <Category: 'Classical Music'>, <Category: 'Art Book'>, <Category: 'Hardware'>, <Category: 'Comics'>, <Category: 'Digital Art'>, <Category: 'Graphic Design'>, <Category: 'Documentary'>, <Category: 'Video Games'>, <Category: 'Country & Folk'>, <Category: 'Children's Book'>, <Category: 'Open Software'>, <Category: 'Dance'>, <Category: 'Illustration'>, <Category: 'Product Design'>, <Category: 'Narrative Film'>, <Category: 'Electronic Music'>, <Category: 'Fiction'>, <Category: 'Design'>, <Category: 'Journalism'>, <Category: 'Painting'>, <Category: 'Short Film'>, <Category: 'Hip-Hop'>, <Category: 'Fashion'>, <Category: 'Performance Art'>, <Category: 'Webseries'>, <Category: 'Indie Rock'>, <Category: 'Nonfiction'>, <Category: 'Film & Video'>, <Category: 'Jazz'>, <Category: 'Periodical'>, <Category: 'Food'>, <Category: 'Pop'>, <Category: 'Poetry'>, <Category: 'Mixed Media'>, <Category: 'Games'>, <Category: 'Rock'>, <Category: 'Public Art'>, <Category: 'Radio & Podcast'>, <Category: 'Music'>, <Category: 'Sculpture'>, <Category: 'World Music'>, <Category: 'Photography'>, <Category: 'Publishing'>, <Category: 'Technology'>, <Category: 'Theater'>]
|
120
120
|
|
121
|
-
category =
|
121
|
+
category = c.category('product design')
|
122
122
|
=> <Category: 'Product Design'>
|
123
123
|
|
124
124
|
category.keys
|
data/lib/kickscraper/client.rb
CHANGED
@@ -162,7 +162,7 @@ module Kickscraper
|
|
162
162
|
else
|
163
163
|
|
164
164
|
if @last_api_call_params && !body.total_hits.nil?
|
165
|
-
@more_projects_available = @last_api_call_params[:page] *
|
165
|
+
@more_projects_available = @last_api_call_params[:page] * 12 < body.total_hits # (there is a huge assumption here that Kickstarter will always return 12 projects per full page!) (in fact, this has changed over the years from 20 to 24 to 12)
|
166
166
|
end
|
167
167
|
|
168
168
|
return body.projects.map { |project| Project.coerce project }
|
data/lib/kickscraper/version.rb
CHANGED
@@ -20,32 +20,32 @@ describe Kickscraper::Client do
|
|
20
20
|
describe ".find_user" do
|
21
21
|
subject(:user) { client.find_user TEST_USER_ID }
|
22
22
|
|
23
|
-
|
23
|
+
its(:id) { should == TEST_USER_ID }
|
24
|
+
its(:name) { should == 'Zach Braff' }
|
24
25
|
end
|
25
26
|
|
26
|
-
describe ".
|
27
|
+
describe ".find_project" do
|
27
28
|
subject(:project) { client.find_project TEST_PROJECT_ID }
|
28
29
|
|
29
|
-
|
30
|
+
its(:id) { should == TEST_PROJECT_ID }
|
31
|
+
its(:slug) { should == TEST_PROJECT_SLUG }
|
32
|
+
its(:name) { should == TEST_PROJECT_NAME }
|
30
33
|
end
|
31
34
|
|
32
35
|
describe ".categories" do
|
33
36
|
subject { client.categories }
|
34
|
-
|
35
|
-
it { should eq [] } # don't know how to do on purely Public API
|
37
|
+
it_returns "a collection", Kickscraper::Category
|
36
38
|
end
|
37
39
|
|
38
40
|
describe ".category" do
|
39
41
|
context "loads a category from string" do
|
40
42
|
subject { client.category(TEST_CATEGORY_NAME) }
|
41
|
-
|
42
|
-
it { should be_nil } # don't know how to do on purely Public API
|
43
|
+
its(:name) { should eq TEST_CATEGORY_NAME }
|
43
44
|
end
|
44
45
|
|
45
46
|
context "loads a category from an id" do
|
46
47
|
subject { client.category(TEST_CATEGORY_ID) }
|
47
|
-
|
48
|
-
it { should be_nil } # don't know how to do on purely Public API
|
48
|
+
its(:name) { should eq TEST_CATEGORY_NAME }
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -35,7 +35,7 @@ describe Kickscraper::Project do
|
|
35
35
|
(project.successful?.is_a?(TrueClass) || project.successful?.is_a?(FalseClass)).should be_true
|
36
36
|
project.category.should be_a Kickscraper::Category
|
37
37
|
project.video.should be_nil
|
38
|
-
project.rewards.
|
38
|
+
project.rewards.should_not be_nil
|
39
39
|
end
|
40
40
|
|
41
41
|
it "reloads" do
|
@@ -49,20 +49,18 @@ describe Kickscraper::Project do
|
|
49
49
|
project.creator.should be_a Kickscraper::User
|
50
50
|
end
|
51
51
|
|
52
|
-
it "loads empty array for comments that depend on user being
|
52
|
+
it "loads empty array for comments that depend on user being logged in and called by a separate API call" do
|
53
53
|
projects = client.popular_projects
|
54
54
|
project = projects[0]
|
55
|
-
|
56
|
-
|
57
|
-
comments.length.should be == 0
|
55
|
+
|
56
|
+
project.comments.should_not be_nil
|
58
57
|
end
|
59
58
|
|
60
|
-
it "loads empty array for updates that depend on user being
|
59
|
+
it "loads empty array for updates that depend on user being logged in and called by a separate API call" do
|
61
60
|
projects = client.popular_projects
|
62
61
|
project = projects[0]
|
63
|
-
|
64
|
-
|
65
|
-
updates.length.should be == 0
|
62
|
+
|
63
|
+
project.updates.should_not be_nil
|
66
64
|
end
|
67
65
|
|
68
66
|
|
@@ -70,7 +68,7 @@ describe Kickscraper::Project do
|
|
70
68
|
projects = client.recently_launched_projects
|
71
69
|
project = projects[0]
|
72
70
|
|
73
|
-
project.rewards.
|
71
|
+
project.rewards.should_not be_nil
|
74
72
|
end
|
75
73
|
end
|
76
74
|
end
|
@@ -89,13 +89,13 @@ shared_examples_for "search projects" do
|
|
89
89
|
# https://www.kickstarter.com/projects/search?utf8=✓&term=%22angels%22+%26+demons+%21%40%23%24%27%25%5E%26*%28%29
|
90
90
|
it "handles searching for projects with isolated special characters" do
|
91
91
|
projects = client.search_projects %q{"angels" & demons !@#$'%^&*()}
|
92
|
-
projects.length.should ==
|
92
|
+
projects.length.should == 12
|
93
93
|
end
|
94
94
|
|
95
95
|
# https://www.kickstarter.com/projects/search?utf8=✓&term=%22angels%22+%26demons%21%40%23%24%27%25%5E%26*%28%29
|
96
96
|
it "handles searching for projects with embedded special characters" do
|
97
97
|
projects = client.search_projects %q{"angels" &demons!@#$'%^&*()}
|
98
|
-
projects.length.should
|
98
|
+
projects.length.should == 12
|
99
99
|
end
|
100
100
|
|
101
101
|
# https://www.kickstarter.com/projects/search?term=Æsir
|
data/spec/test_constants.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# configure kickscraper before the tests
|
2
2
|
# (put your real kickstarter API credentials here)
|
3
3
|
KICKSCRAPER_TEST_API_EMAIL = 'jumpkick.us@gmail.com'
|
4
|
-
KICKSCRAPER_TEST_API_PASSWORD = '
|
4
|
+
KICKSCRAPER_TEST_API_PASSWORD = 'completelySoCreative394838'
|
5
5
|
|
6
6
|
|
7
7
|
# if you want to use a proxy (like Charles, etc) to capture
|
data/spec/user_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kickscraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Olson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.6.12
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: API library for Kickstarter
|