gratitude 0.0.9 → 0.0.10
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/.travis.yml +4 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +119 -19
- data/Rakefile +9 -1
- data/lib/gratitude/tips.rb +36 -26
- data/lib/gratitude/version.rb +1 -1
- data/spec/cassettes/get_tips.json +63 -1
- data/spec/cassettes/post_multiple_tips.json +68 -1
- data/spec/cassettes/post_single_tip.json +68 -1
- data/spec/cassettes/post_tip_error.json +68 -1
- data/spec/cassettes/statistics.json +113 -1
- data/spec/cassettes/update_and_prune.json +193 -0
- data/spec/gratitude/client_spec.rb +15 -13
- data/spec/gratitude/payday_spec.rb +46 -56
- data/spec/gratitude/profile_spec.rb +57 -78
- data/spec/gratitude/statistics_spec.rb +63 -70
- data/spec/gratitude/tips_spec.rb +67 -159
- data/spec/gratitude/version_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3426a86627d58024de176a96959857d0032a69d
|
4
|
+
data.tar.gz: c918f9fc3804023c7985c283c967d37dd83eae8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beacd24fcdf3e11cc1459d76a9dc4bdaf3361368c2bc235a0c4d7faa42b2285d5d4e90cc7f45372b6ac40282dcc73cc2390006a24ebe3039f5408900fcbe95dc
|
7
|
+
data.tar.gz: 87acf159f83bde5b85702f7a89e2bfac096fbc7db258aefb49c6e99ce29fecc24ff1d1be4752473fe0fea0bc37cbaf11f237ec61f40540a82fc68fe36ad471c1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
### 0.1.0 (Upcoming Stable Release)
|
2
2
|
* Implement all aspects of the Gittip API.
|
3
3
|
|
4
|
+
### 0.0.10
|
5
|
+
* Add rake console task to enter an IRB session with Gratitude required
|
6
|
+
* Simplify Tip's public interface
|
7
|
+
|
8
|
+
### 0.0.9 (10/19/2013)
|
9
|
+
* Add ability to update a user's current tips.
|
10
|
+
|
4
11
|
### 0.0.8 (10/18/2013)
|
5
12
|
* Add client authentication.
|
6
13
|
* Add ability to retrieve a user's current tips.
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2014 John Kelly Ferguson
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
data/README.md
CHANGED
@@ -31,7 +31,9 @@ When using gratitude to retrieve data from the Gittip API, please note that many
|
|
31
31
|
|
32
32
|
The Gittip API provides access to the historical data of all its paydays. To retrieve this information, simply use the following command:
|
33
33
|
|
34
|
-
|
34
|
+
```ruby
|
35
|
+
Gratitude::Payday.all
|
36
|
+
```
|
35
37
|
|
36
38
|
The above will return an array of Payday objects. Each Payday object responds to the following methods:
|
37
39
|
|
@@ -53,26 +55,34 @@ The above will return an array of Payday objects. Each Payday object responds to
|
|
53
55
|
|
54
56
|
You can then iterate through this array of payday objects to persist them to a database or get whatever information you need.
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
```ruby
|
59
|
+
paydays = Gratitude::Payday.all
|
60
|
+
paydays.each do |payday|
|
61
|
+
# get whatever information you want from the payday object
|
62
|
+
# using the above mentioned methods.
|
63
|
+
end
|
64
|
+
```
|
61
65
|
|
62
66
|
Finally, if you just want to get the most recent payday, you can do so by using:
|
63
67
|
|
64
|
-
|
68
|
+
```ruby
|
69
|
+
Gratitude::Payday.most_recent
|
70
|
+
```
|
65
71
|
|
66
72
|
##Statistics ([source code](https://github.com/JohnKellyFerguson/gratitude/blob/master/lib/gratitude/statistics.rb))
|
67
73
|
The Statistics aspect of the Gittip API provides the current statistics, as of that moment in time, for Gittip. Note that these stats can potentially change when making subsequent requests.
|
68
74
|
|
69
75
|
If you would like to get the current Gittip stats, you can do so by using:
|
70
76
|
|
71
|
-
|
77
|
+
```ruby
|
78
|
+
Gratitude::Statistics.current
|
79
|
+
```
|
72
80
|
|
73
81
|
Alternatively, you can also use:
|
74
82
|
|
75
|
-
|
83
|
+
```ruby
|
84
|
+
Gratitude::Statistics.new
|
85
|
+
```
|
76
86
|
|
77
87
|
Each of the above will return an object containing all of the current Gittip stats. You can access each of the Gittip stats using the following methods:
|
78
88
|
|
@@ -97,8 +107,8 @@ Each of the above will return an object containing all of the current Gittip sta
|
|
97
107
|
* `this_thursday`
|
98
108
|
* This refers to the upcoming Thursday when payments/transfers are set to occur. Possible values include: "this Thursday", "today", "right now!", and "next Thursday"
|
99
109
|
* `tip_distribution_json`
|
100
|
-
* This returns a hash. Each key in the hash is a float which represents a tip amount (for example, $0.01, $0.25 or $1). The value of each key is an array. The first element in the array is an integer representing the total number of users who have pledged that amount. The second element in the array is a float which shows how much this tip amount makes up all
|
101
|
-
|
110
|
+
* This returns a hash. Each key in the hash is a float which represents a tip amount (for example, $0.01, $0.25 or $1). The value of each key is an array. The first element in the array is an integer representing the total number of users who have pledged that amount. The second element in the array is a float which shows how much this tip amount makes up of all the possible tips. For example, the hash returned will look like the following: `{ 0.01: [11, 0.002153484729835552], … }`
|
111
|
+
|
102
112
|
In this example, the amount being tipped is $0.01. The amount of users tipping this amount is 11, and the total tip amount for this tip size makes up 0.2153484729835552% of all tips distributed. The hash will contain many more elements, each with the same structure.
|
103
113
|
* `number_of_tips` (alias: `tip_n`)
|
104
114
|
* `value_of_total_backed_tips` (alias: `total_backed_tips`)
|
@@ -108,7 +118,9 @@ Each of the above will return an object containing all of the current Gittip sta
|
|
108
118
|
|
109
119
|
The Profile aspect of the Gittip API allows you to get the public profile information of any Gittip user. To do so, just pass their username as an initialization argument to the `Gratitude::Profile` class.
|
110
120
|
|
111
|
-
|
121
|
+
```ruby
|
122
|
+
Gratitude::Profile.new("johnkellyferguson")
|
123
|
+
```
|
112
124
|
|
113
125
|
The above will retrieve the public profile of the above user. You can then access all of the different information with the following methods:
|
114
126
|
|
@@ -150,13 +162,16 @@ The above will retrieve the public profile of the above user. You can then acces
|
|
150
162
|
**TODO:** Implement the `my_tip` method into the Profile section once client authentication is finished.
|
151
163
|
|
152
164
|
##Tips ([client authentication source code](https://github.com/JohnKellyFerguson/gratitude/blob/master/lib/gratitude/client.rb), [tips source code](https://github.com/JohnKellyFerguson/gratitude/blob/master/lib/gratitude/tips.rb))
|
153
|
-
The Tips aspect of the Gittip API allows you to retrieve the current tips of
|
165
|
+
The Tips aspect of the Gittip API allows you to retrieve and update the current tips of an authenticated user. In order to interact with this aspect of the API, you will need your username and API_KEY. To find out your API Key, log into your Gittip account, go to your profile and at the bottom of the page you will find your API_KEY.
|
154
166
|
|
155
167
|

|
156
168
|
|
157
|
-
Now that you have your API_KEY, you can find out your current tips using Gratitude.
|
169
|
+
Now that you have your API_KEY, you can find out your current tips or update your tips using Gratitude.
|
158
170
|
|
159
|
-
|
171
|
+
### Determing Current Tips
|
172
|
+
To find out the current tips of a user, follow these instructions:
|
173
|
+
|
174
|
+
```ruby
|
160
175
|
# First establish a connection to the Gittip API by passing in your credentials to Gratitude::Client.new
|
161
176
|
# You will need to pass in your username and api key like so.
|
162
177
|
client = Gratitude::Client.new(:username => "my_username", :api_key => "my_api_key")
|
@@ -167,22 +182,107 @@ This will will return an array of hashes that represent your current tips and wi
|
|
167
182
|
|
168
183
|
|
169
184
|
[
|
185
|
+
{"amount"=>"2.00", "platform"=>"gittip", "username"=>"gittip"},
|
170
186
|
{"amount"=>"1.00", "platform"=>"gittip", "username"=>"whit537"},
|
171
|
-
{"amount"=>"0.25", "platform"=>"gittip", "username"=>"JohnKellyFerguson"}
|
172
|
-
…
|
187
|
+
{"amount"=>"0.25", "platform"=>"gittip", "username"=>"JohnKellyFerguson"}
|
173
188
|
]
|
174
189
|
|
175
190
|
Please be aware that all of the amounts in the hash are strings and not floats.
|
176
191
|
|
192
|
+
In addition, you can also find out the current total of all of a user's tips by using the `current_tips_total` method. This will return a float with a total of all of the user's tips.
|
193
|
+
|
194
|
+
```ruby
|
195
|
+
# Continuing the example
|
196
|
+
client.current_tips_total
|
197
|
+
=> 3.25
|
198
|
+
```
|
199
|
+
|
200
|
+
### Updating Tips
|
201
|
+
It is also possible to update a user's tips. To do so, we will once again have to pass in our authentication information (or use our previously stored information).
|
202
|
+
|
203
|
+
```ruby
|
204
|
+
client = Gratitude::Client.new(:username => "my_username", :api_key => "my_api_key")
|
205
|
+
```
|
206
|
+
We can then call the `update_tips` method, which accepts an array of hashes containing a user's username and desired tip amount.
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
client.update_tips([ { :username => "gittip", :amount => "3.50" },
|
210
|
+
{ :username => "whit537", :amount => "3.50"},
|
211
|
+
{ :username => "JohnKellyFerguson", :amount = "3.50" }])
|
212
|
+
```
|
213
|
+
|
214
|
+
When tips are successfully updated, the `update_tips` method will return an array representing the successfully updated tips.
|
215
|
+
|
216
|
+
```ruby
|
217
|
+
[
|
218
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"gittip"},
|
219
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"whit537"},
|
220
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"JohnKellyFerguson"}
|
221
|
+
]
|
222
|
+
```
|
223
|
+
Please note that you do not have to update all of a user's tips when using the `update_tips` method and that it is possible to either update only a subset of a user's tips or to add new tips.
|
224
|
+
|
225
|
+
For example:
|
226
|
+
|
227
|
+
```ruby
|
228
|
+
client.update_tips([ { :username => "gittip", :amount => "4.50" } ])
|
229
|
+
```
|
230
|
+
will only updates the tips going to the "gittip"" user. All other tips will remain unchanged. We can see this by continuing our example and running the `current_tips` method.
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
client.current_tips
|
234
|
+
=> [
|
235
|
+
{"amount"=>"4.50", "platform"=>"gittip", "username"=>"gittip"},
|
236
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"whit537"},
|
237
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"JohnKellyFerguson"}
|
238
|
+
]
|
239
|
+
```
|
240
|
+
|
241
|
+
New tips can also be added using the `update_tips` method.
|
242
|
+
|
243
|
+
```ruby
|
244
|
+
client.update_tips([ { :username => "steveklabnik", :amount=> "1.00" }])
|
245
|
+
```
|
246
|
+
The new tip will be added to the previously existing tips.
|
247
|
+
|
248
|
+
```ruby
|
249
|
+
client.current_tips
|
250
|
+
=> [
|
251
|
+
{"amount"=>"4.50", "platform"=>"gittip", "username"=>"gittip"},
|
252
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"whit537"},
|
253
|
+
{"amount"=>"3.50", "platform"=>"gittip", "username"=>"JohnKellyFerguson"},
|
254
|
+
{"amount"=>"1.00", "platform"=>"gittip", "username"=>"steveklabnik"}
|
255
|
+
]
|
256
|
+
```
|
257
|
+
|
258
|
+
Finally, gratitude comes with the ability to update a specific tip and remove all other tips. This can be accomplished by using the `update_tips_and_prune` method, which again takes an array of hashes containing a user's username and desired tip amount.
|
259
|
+
|
260
|
+
```ruby
|
261
|
+
client.update_tips_and_prune([ { :username => "gittip", :amount => "25.00" } ])
|
262
|
+
```
|
177
263
|
|
264
|
+
Like the `update_tips` method, `update_tips_and_prune` will return an array of the successfully updated tips.
|
178
265
|
|
179
|
-
|
266
|
+
```ruby
|
267
|
+
[
|
268
|
+
{"amount"=>"25.00", "platform"=>"gittip", "username"=>"gittip"}
|
269
|
+
]
|
270
|
+
```
|
271
|
+
|
272
|
+
All other tips have been removed, which we can see by using the `current_tips` method.
|
273
|
+
|
274
|
+
```ruby
|
275
|
+
client.current_tips
|
276
|
+
=> [
|
277
|
+
{"amount"=>"25.00", "platform"=>"gittip", "username"=>"gittip"}
|
278
|
+
]
|
279
|
+
```
|
180
280
|
|
181
281
|
|
182
282
|
|
183
283
|
### Copyright and License
|
184
284
|
|
185
|
-
Copyright John Kelly Ferguson and Contributors,
|
285
|
+
Copyright John Kelly Ferguson and Contributors, 2014
|
186
286
|
|
187
287
|
[MIT Licence](LICENSE.txt)
|
188
288
|
|
data/Rakefile
CHANGED
@@ -10,4 +10,12 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
10
10
|
spec.pattern = FileList["spec/**/*_spec.rb"]
|
11
11
|
end
|
12
12
|
|
13
|
-
task :default => :spec
|
13
|
+
task :default => :spec
|
14
|
+
|
15
|
+
task :console do
|
16
|
+
require 'irb'
|
17
|
+
require 'irb/completion'
|
18
|
+
require 'gratitude'
|
19
|
+
ARGV.clear
|
20
|
+
IRB.start
|
21
|
+
end
|
data/lib/gratitude/tips.rb
CHANGED
@@ -3,7 +3,7 @@ module Gratitude
|
|
3
3
|
module Tips
|
4
4
|
|
5
5
|
def current_tips
|
6
|
-
self.class.get(tips_url,
|
6
|
+
self.class.get(tips_url, basic_auth).parsed_response
|
7
7
|
end
|
8
8
|
|
9
9
|
def current_tips_total
|
@@ -11,46 +11,56 @@ module Gratitude
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def update_tips(array_of_hashes_with_usernames_and_amounts)
|
14
|
-
self.class.post(
|
15
|
-
|
16
|
-
|
17
|
-
:basic_auth => authorization,
|
18
|
-
:headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
19
|
-
})
|
14
|
+
self.class.post(
|
15
|
+
tips_url, request_payload(array_of_hashes_with_usernames_and_amounts)
|
16
|
+
)
|
20
17
|
end
|
21
18
|
|
22
19
|
def update_tips_and_prune(array_of_hashes_with_usernames_and_amounts)
|
23
|
-
self.class.post(
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
:headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
29
|
-
})
|
20
|
+
self.class.post(
|
21
|
+
tips_url,
|
22
|
+
request_payload(array_of_hashes_with_usernames_and_amounts)
|
23
|
+
.merge(:query => { :also_prune => "true"})
|
24
|
+
)
|
30
25
|
end
|
31
26
|
|
27
|
+
private
|
28
|
+
|
32
29
|
def tips_url
|
33
30
|
"https://www.gittip.com/#{username}/tips.json"
|
34
31
|
end
|
35
32
|
|
36
|
-
def
|
37
|
-
{
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
{ "amount" => "#{amount}", "platform" => "gittip", "username" => "#{username}" }
|
33
|
+
def request_payload(array_of_hashes)
|
34
|
+
{
|
35
|
+
:body => prepared_tips_array(array_of_hashes).to_json,
|
36
|
+
:headers => json_header
|
37
|
+
}.merge(basic_auth)
|
42
38
|
end
|
43
39
|
|
44
|
-
def prepared_tips_array(
|
45
|
-
|
46
|
-
array_of_hashes_with_usernames_and_amounts.each do |hash|
|
40
|
+
def prepared_tips_array(array_of_hashes)
|
41
|
+
array_of_hashes.each_with_object([]) do |hash, array|
|
47
42
|
username = hash[:username] || hash["username"]
|
48
43
|
amount = hash[:amount] || hash["amount"]
|
49
|
-
|
44
|
+
array << tip_hash_based_upon(username, amount)
|
50
45
|
end
|
51
|
-
|
46
|
+
end
|
47
|
+
|
48
|
+
def tip_hash_based_upon(username, amount)
|
49
|
+
{
|
50
|
+
"amount" => "#{amount}",
|
51
|
+
"platform" => "gittip",
|
52
|
+
"username" => "#{username}"
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
def json_header
|
57
|
+
{ 'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
58
|
+
end
|
59
|
+
|
60
|
+
def basic_auth
|
61
|
+
{ :basic_auth => { :username => api_key } }
|
52
62
|
end
|
53
63
|
|
54
64
|
end # Tips
|
55
65
|
end # Client
|
56
|
-
end # Gratitude
|
66
|
+
end # Gratitude
|
data/lib/gratitude/version.rb
CHANGED
@@ -1 +1,63 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"http_interactions":[
|
3
|
+
{
|
4
|
+
"request":{
|
5
|
+
"method":"get",
|
6
|
+
"uri":"https://5962b93a-5bf7-4cb6-ae6f-aa4114c5e4f2:@www.gittip.com/gratitude_test/tips.json",
|
7
|
+
"body":{
|
8
|
+
"encoding":"US-ASCII",
|
9
|
+
"string":""
|
10
|
+
},
|
11
|
+
"headers":{
|
12
|
+
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"response":{
|
16
|
+
"status":{
|
17
|
+
"code":200,
|
18
|
+
"message":"OK"
|
19
|
+
},
|
20
|
+
"headers":{
|
21
|
+
"Content-Type":[
|
22
|
+
"application/json"
|
23
|
+
],
|
24
|
+
"Date":[
|
25
|
+
"Sun, 20 Oct 2013 01:41:31 GMT"
|
26
|
+
],
|
27
|
+
"Expires":[
|
28
|
+
"Thu, 01 Jan 1970 00:00:00 GMT"
|
29
|
+
],
|
30
|
+
"Server":[
|
31
|
+
"Aspen! Cheroot!"
|
32
|
+
],
|
33
|
+
"Set-Cookie":[
|
34
|
+
"csrf_token=qJFOtxb2kGqZhrlXEv5QRrLcP3H0wik9; expires=Sun, 19 Oct 2014 01:41:31 GMT; Path=/",
|
35
|
+
"session=c08eaad1dae3407c9d31f5ca904364bd; expires=Sun, 27 Oct 2013 01:41:31 GMT; httponly; Path=/; secure"
|
36
|
+
],
|
37
|
+
"Vary":[
|
38
|
+
"Cookie"
|
39
|
+
],
|
40
|
+
"X-Frame-Options":[
|
41
|
+
"SAMEORIGIN"
|
42
|
+
],
|
43
|
+
"X-Gittip-Version":[
|
44
|
+
"10.1.35"
|
45
|
+
],
|
46
|
+
"Content-Length":[
|
47
|
+
"210"
|
48
|
+
],
|
49
|
+
"Connection":[
|
50
|
+
"keep-alive"
|
51
|
+
]
|
52
|
+
},
|
53
|
+
"body":{
|
54
|
+
"encoding":"UTF-8",
|
55
|
+
"string":"[\n {\n \"amount\": \"1.00\",\n \"platform\": \"gittip\",\n \"username\": \"whit537\"\n },\n {\n \"amount\": \"0.25\",\n \"platform\": \"gittip\",\n \"username\": \"JohnKellyFerguson\"\n }\n]"
|
56
|
+
},
|
57
|
+
"http_version":null
|
58
|
+
},
|
59
|
+
"recorded_at":"Sun, 20 Oct 2013 01:41:36 GMT"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"recorded_with":"VCR 2.5.0"
|
63
|
+
}
|
@@ -1 +1,68 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"http_interactions":[
|
3
|
+
{
|
4
|
+
"request":{
|
5
|
+
"method":"post",
|
6
|
+
"uri":"https://5962b93a-5bf7-4cb6-ae6f-aa4114c5e4f2:@www.gittip.com/gratitude_test/tips.json",
|
7
|
+
"body":{
|
8
|
+
"encoding":"UTF-8",
|
9
|
+
"string":"[{\"amount\":\"10\",\"platform\":\"gittip\",\"username\":\"whit537\"},{\"amount\":\"4\",\"platform\":\"gittip\",\"username\":\"JohnKellyFerguson\"}]"
|
10
|
+
},
|
11
|
+
"headers":{
|
12
|
+
"Content-Type":[
|
13
|
+
"application/json"
|
14
|
+
],
|
15
|
+
"Accept":[
|
16
|
+
"application/json"
|
17
|
+
]
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"response":{
|
21
|
+
"status":{
|
22
|
+
"code":200,
|
23
|
+
"message":"OK"
|
24
|
+
},
|
25
|
+
"headers":{
|
26
|
+
"Content-Type":[
|
27
|
+
"application/json"
|
28
|
+
],
|
29
|
+
"Date":[
|
30
|
+
"Sun, 20 Oct 2013 03:12:30 GMT"
|
31
|
+
],
|
32
|
+
"Expires":[
|
33
|
+
"Thu, 01 Jan 1970 00:00:00 GMT"
|
34
|
+
],
|
35
|
+
"Server":[
|
36
|
+
"Aspen! Cheroot!"
|
37
|
+
],
|
38
|
+
"Set-Cookie":[
|
39
|
+
"csrf_token=zpQWN7H1DlHpCQvAB9mPs7aMjXroYDOV; expires=Sun, 19 Oct 2014 03:12:30 GMT; Path=/",
|
40
|
+
"session=c08eaad1dae3407c9d31f5ca904364bd; expires=Sun, 27 Oct 2013 03:12:30 GMT; httponly; Path=/; secure"
|
41
|
+
],
|
42
|
+
"Vary":[
|
43
|
+
"Cookie"
|
44
|
+
],
|
45
|
+
"X-Frame-Options":[
|
46
|
+
"SAMEORIGIN"
|
47
|
+
],
|
48
|
+
"X-Gittip-Version":[
|
49
|
+
"10.1.35"
|
50
|
+
],
|
51
|
+
"Content-Length":[
|
52
|
+
"205"
|
53
|
+
],
|
54
|
+
"Connection":[
|
55
|
+
"keep-alive"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
"body":{
|
59
|
+
"encoding":"UTF-8",
|
60
|
+
"string":"[\n {\n \"amount\": \"10\",\n \"platform\": \"gittip\",\n \"username\": \"whit537\"\n },\n {\n \"amount\": \"4\",\n \"platform\": \"gittip\",\n \"username\": \"JohnKellyFerguson\"\n }\n]"
|
61
|
+
},
|
62
|
+
"http_version":null
|
63
|
+
},
|
64
|
+
"recorded_at":"Sun, 20 Oct 2013 03:12:37 GMT"
|
65
|
+
}
|
66
|
+
],
|
67
|
+
"recorded_with":"VCR 2.5.0"
|
68
|
+
}
|
@@ -1 +1,68 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"http_interactions":[
|
3
|
+
{
|
4
|
+
"request":{
|
5
|
+
"method":"post",
|
6
|
+
"uri":"https://5962b93a-5bf7-4cb6-ae6f-aa4114c5e4f2:@www.gittip.com/gratitude_test/tips.json",
|
7
|
+
"body":{
|
8
|
+
"encoding":"UTF-8",
|
9
|
+
"string":"[{\"amount\":\"5\",\"platform\":\"gittip\",\"username\":\"whit537\"}]"
|
10
|
+
},
|
11
|
+
"headers":{
|
12
|
+
"Content-Type":[
|
13
|
+
"application/json"
|
14
|
+
],
|
15
|
+
"Accept":[
|
16
|
+
"application/json"
|
17
|
+
]
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"response":{
|
21
|
+
"status":{
|
22
|
+
"code":200,
|
23
|
+
"message":"OK"
|
24
|
+
},
|
25
|
+
"headers":{
|
26
|
+
"Content-Type":[
|
27
|
+
"application/json"
|
28
|
+
],
|
29
|
+
"Date":[
|
30
|
+
"Sun, 20 Oct 2013 03:09:02 GMT"
|
31
|
+
],
|
32
|
+
"Expires":[
|
33
|
+
"Thu, 01 Jan 1970 00:00:00 GMT"
|
34
|
+
],
|
35
|
+
"Server":[
|
36
|
+
"Aspen! Cheroot!"
|
37
|
+
],
|
38
|
+
"Set-Cookie":[
|
39
|
+
"csrf_token=DRdyOGvuZo1D9zPRfgzXAbhOpQrP03Na; expires=Sun, 19 Oct 2014 03:09:02 GMT; Path=/",
|
40
|
+
"session=c08eaad1dae3407c9d31f5ca904364bd; expires=Sun, 27 Oct 2013 03:09:02 GMT; httponly; Path=/; secure"
|
41
|
+
],
|
42
|
+
"Vary":[
|
43
|
+
"Cookie"
|
44
|
+
],
|
45
|
+
"X-Frame-Options":[
|
46
|
+
"SAMEORIGIN"
|
47
|
+
],
|
48
|
+
"X-Gittip-Version":[
|
49
|
+
"10.1.35"
|
50
|
+
],
|
51
|
+
"Content-Length":[
|
52
|
+
"98"
|
53
|
+
],
|
54
|
+
"Connection":[
|
55
|
+
"keep-alive"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
"body":{
|
59
|
+
"encoding":"UTF-8",
|
60
|
+
"string":"[\n {\n \"amount\": \"5\",\n \"platform\": \"gittip\",\n \"username\": \"whit537\"\n }\n]"
|
61
|
+
},
|
62
|
+
"http_version":null
|
63
|
+
},
|
64
|
+
"recorded_at":"Sun, 20 Oct 2013 03:09:09 GMT"
|
65
|
+
}
|
66
|
+
],
|
67
|
+
"recorded_with":"VCR 2.5.0"
|
68
|
+
}
|
@@ -1 +1,68 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"http_interactions":[
|
3
|
+
{
|
4
|
+
"request":{
|
5
|
+
"method":"post",
|
6
|
+
"uri":"https://5962b93a-5bf7-4cb6-ae6f-aa4114c5e4f2:@www.gittip.com/gratitude_test/tips.json",
|
7
|
+
"body":{
|
8
|
+
"encoding":"UTF-8",
|
9
|
+
"string":"[{\"amount\":\"20\",\"platform\":\"gittip\",\"username\":\"not_a_real_user\"}]"
|
10
|
+
},
|
11
|
+
"headers":{
|
12
|
+
"Content-Type":[
|
13
|
+
"application/json"
|
14
|
+
],
|
15
|
+
"Accept":[
|
16
|
+
"application/json"
|
17
|
+
]
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"response":{
|
21
|
+
"status":{
|
22
|
+
"code":200,
|
23
|
+
"message":"OK"
|
24
|
+
},
|
25
|
+
"headers":{
|
26
|
+
"Content-Type":[
|
27
|
+
"application/json"
|
28
|
+
],
|
29
|
+
"Date":[
|
30
|
+
"Sun, 20 Oct 2013 03:21:36 GMT"
|
31
|
+
],
|
32
|
+
"Expires":[
|
33
|
+
"Thu, 01 Jan 1970 00:00:00 GMT"
|
34
|
+
],
|
35
|
+
"Server":[
|
36
|
+
"Aspen! Cheroot!"
|
37
|
+
],
|
38
|
+
"Set-Cookie":[
|
39
|
+
"csrf_token=iyQSAZVfmuWKaWltmYauK2Jadl8oCunm; expires=Sun, 19 Oct 2014 03:21:36 GMT; Path=/",
|
40
|
+
"session=c08eaad1dae3407c9d31f5ca904364bd; expires=Sun, 27 Oct 2013 03:21:36 GMT; httponly; Path=/; secure"
|
41
|
+
],
|
42
|
+
"Vary":[
|
43
|
+
"Cookie"
|
44
|
+
],
|
45
|
+
"X-Frame-Options":[
|
46
|
+
"SAMEORIGIN"
|
47
|
+
],
|
48
|
+
"X-Gittip-Version":[
|
49
|
+
"10.1.35"
|
50
|
+
],
|
51
|
+
"Content-Length":[
|
52
|
+
"141"
|
53
|
+
],
|
54
|
+
"Connection":[
|
55
|
+
"keep-alive"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
"body":{
|
59
|
+
"encoding":"UTF-8",
|
60
|
+
"string":"[\n {\n \"amount\": \"e\",\n \"error\": \"IntegrityError\",\n \"platform\": \"gittip\",\n \"username\": \"not_a_real_user\"\n }\n]"
|
61
|
+
},
|
62
|
+
"http_version":null
|
63
|
+
},
|
64
|
+
"recorded_at":"Sun, 20 Oct 2013 03:21:43 GMT"
|
65
|
+
}
|
66
|
+
],
|
67
|
+
"recorded_with":"VCR 2.5.0"
|
68
|
+
}
|