chimps 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -13
- data/VERSION +1 -1
- data/lib/chimps/workflows/download.rb +1 -1
- data/spec/chimps/request_spec.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
= Who
|
1
|
+
= Who _are_ these Chimps?
|
2
2
|
|
3
3
|
Infochimps[http://www.infochimps.com] is an online data marketplace
|
4
4
|
and repository where anyone can find, share, and sell data.
|
5
5
|
|
6
6
|
Infochimps offers two APIs for users to access and modify data
|
7
7
|
|
8
|
-
- a {Dataset API}[http://www.infochimps.com/
|
9
|
-
- a {Query API}[http://www.infochimps.com/
|
8
|
+
- a {Dataset API}[http://www.infochimps.com/apis] to list, show, create, update, and destroy datasets and associated resources on Infochimps[http://www.infochimps.com]
|
9
|
+
- a {Query API}[http://www.infochimps.com/apis] to query data from particular rows of these datasets
|
10
10
|
|
11
|
-
*Chimps* is a Ruby library that makes interacting with Infochimps'
|
12
|
-
APIs as easy as
|
11
|
+
*Chimps* is a Ruby library that makes interacting with Infochimps' APIs as easy as
|
13
12
|
|
14
13
|
require 'rubygems'
|
15
14
|
require 'chimps'
|
@@ -54,7 +53,7 @@ for an Infochimps account}[http://www.infochimps.com/signup] and get
|
|
54
53
|
your {Dataset API key}[http://www.infochimps.com/me].
|
55
54
|
|
56
55
|
To query particular rows from a dataset, you'll also need to get a
|
57
|
-
{Query API key}[http://www.infochimps.com/
|
56
|
+
{Query API key}[http://www.infochimps.com/apis].
|
58
57
|
|
59
58
|
You can always explicitly set values in <tt>Chimps.config</tt> like
|
60
59
|
in the first example at the top of this +README+ but you may find it
|
@@ -68,7 +67,7 @@ configuration file looks like
|
|
68
67
|
|
69
68
|
# -*-yaml-*-
|
70
69
|
# ~/.chimps
|
71
|
-
:
|
70
|
+
:dataset:
|
72
71
|
:key: xxxxxxxxxxxxxxxx
|
73
72
|
:secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
74
73
|
:query:
|
@@ -92,17 +91,17 @@ when you require it:
|
|
92
91
|
|
93
92
|
== Dataset API
|
94
93
|
|
95
|
-
You can use the {Dataset API}[http://www.infochimps.com/
|
94
|
+
You can use the {Dataset API}[http://www.infochimps.com/apis] to
|
96
95
|
search, list, show, create, update, or destroy datasets and other
|
97
96
|
resources at Infochimps.
|
98
97
|
|
99
|
-
If instead of
|
100
|
-
|
98
|
+
If instead of _creating_ a dataset with 100,000 baby names you want to
|
99
|
+
_query_ a dataset of 100,000 baby names then you should skip down to
|
101
100
|
the Query API section below.
|
102
101
|
|
103
102
|
You can find a complete list of Dataset API endpoints, expected
|
104
103
|
parameters, return codes, documentation, and authentication
|
105
|
-
requirements at http://www.infochimps.com/
|
104
|
+
requirements at http://www.infochimps.com/apis.
|
106
105
|
|
107
106
|
=== A Simple +GET+ Request
|
108
107
|
|
@@ -143,7 +142,7 @@ not require the request to be signed in any way. Other requests,
|
|
143
142
|
which reveal your private information or create new datasets, &c. on
|
144
143
|
Infochimps will require your Dataset API secret to sign. You can see
|
145
144
|
a full list of the Dataset API endpoints available and whether or not
|
146
|
-
requests to each need to be signed at http://www.infochimps.com/
|
145
|
+
requests to each need to be signed at http://www.infochimps.com/apis.
|
147
146
|
|
148
147
|
Assuming you've properly configured Chimps (see above) you ask the
|
149
148
|
request to sign itself.
|
@@ -176,7 +175,7 @@ Here's how to you might create a new dataset via a +POST+ request:
|
|
176
175
|
|
177
176
|
You can find a complete list of what Dataset API endpoints are
|
178
177
|
available and what parameters they take at
|
179
|
-
http://www.infochimps.com/
|
178
|
+
http://www.infochimps.com/apis.
|
180
179
|
|
181
180
|
=== Using the Query API
|
182
181
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
@@ -39,7 +39,7 @@ module Chimps
|
|
39
39
|
#
|
40
40
|
# @return [Chimps::Request]
|
41
41
|
def token_request
|
42
|
-
@token_request ||= Request.new("/
|
42
|
+
@token_request ||= Request.new("/download_tokens", :body => {:download_token => {:dataset_id => dataset}}, :sign_if_possible => true)
|
43
43
|
end
|
44
44
|
|
45
45
|
# A download token from Infochimps containing a signed URL from
|
data/spec/chimps/request_spec.rb
CHANGED
@@ -23,7 +23,7 @@ describe Chimps::Request do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should encode a Hash of query string parameters when given" do
|
26
|
-
Chimps::Request.new('/path/to/something', :query_params => {:foo => 'bar', :fuzz => 'booz'}).query_string.should
|
26
|
+
Chimps::Request.new('/path/to/something', :query_params => {:foo => 'bar', :fuzz => 'booz'}).query_string.should include('foo=bar', 'fuzz=booz')
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should properly URL encode the query string it generates" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chimps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dhruv Bansal
|