link_shrink 0.0.2 → 0.0.3

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.
Files changed (31) hide show
  1. data/.rspec +1 -1
  2. data/.travis.yml +2 -0
  3. data/Changelog.md +13 -0
  4. data/README.md +45 -0
  5. data/lib/link_shrink/cli.rb +15 -3
  6. data/lib/link_shrink/config.rb +24 -0
  7. data/lib/link_shrink/request.rb +5 -3
  8. data/lib/link_shrink/shrinkers/base.rb +41 -6
  9. data/lib/link_shrink/shrinkers/google.rb +18 -6
  10. data/lib/link_shrink/shrinkers/tinyurl.rb +31 -0
  11. data/lib/link_shrink/version.rb +1 -1
  12. data/lib/link_shrink.rb +14 -3
  13. data/link_shrink.gemspec +4 -4
  14. data/spec/link_shrink/config_spec.rb +29 -0
  15. data/spec/link_shrink/google_spec.rb +2 -1
  16. data/spec/link_shrink/link_shrink_spec.rb +31 -2
  17. data/spec/link_shrink/request_spec.rb +3 -6
  18. data/spec/link_shrink/shrinker_base_spec.rb +69 -8
  19. data/spec/link_shrink/tiny_url_spec.rb +43 -0
  20. data/spec/spec_helper.rb +24 -1
  21. data/spec/vcr_cassettes/LinkShrink/_shrink_url/creates_a_short_url.yml +134 -0
  22. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_additional_options/json_option/returns_JSON_when_set_to_true.yml +91 -0
  23. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_additional_options/json_option/returns_default_response_when_set_to_false.yml +91 -0
  24. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_additional_options/qr_code_option/returns_QR_code_when_set_to_true.yml +91 -0
  25. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_additional_options/qr_code_option/returns_default_response_when_set_to_false.yml +91 -0
  26. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_additional_options/returns_default_response_when_called_with_empty_hash.yml +91 -0
  27. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_image_size_200x200/returns_QR_code_link_with_custom_size.yml +91 -0
  28. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_json_and_qr_code_options/returns_qr_code_in_JSON.yml +91 -0
  29. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_json_qr_code_and_image_size_300x300/returns_QR_code_in_JSON_with_custom_size.yml +91 -0
  30. data/spec/vcr_cassettes/LinkShrink/_shrink_url/when_called_with_no_qr_code_and_image_size_200x200/returns_QR_code_link_with_custom_size.yml +95 -0
  31. metadata +44 -18
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ describe LinkShrink::Shrinkers::TinyUrl do
4
+ include_examples 'shared_examples'
5
+
6
+ let(:link_shrink) { described_class.new }
7
+ let(:tiny_url) { 'http://tinyurl.com/api-create.php' }
8
+
9
+ describe '#sub_klass' do
10
+ it 'returns the inherited subclass name' do
11
+ expect(link_shrink.sub_klass).to eq('TinyUrl')
12
+ end
13
+ end
14
+
15
+ describe '#base_url' do
16
+ it 'returns the base_url for the API' do
17
+ expect(link_shrink.base_url)
18
+ .to eq(tiny_url)
19
+ end
20
+ end
21
+
22
+ describe '#api_url' do
23
+ it 'returns full api url' do
24
+ link_shrink.stub(:url).and_return('www.google.com')
25
+
26
+ expect(link_shrink.api_url)
27
+ .to eq('http://tinyurl.com/api-create.php?url=www.google.com')
28
+ end
29
+ end
30
+
31
+ describe '#api_query_parameter' do
32
+ it 'returns query parameter' do
33
+ link_shrink.stub(:url).and_return('www.google.com')
34
+ expect(link_shrink.api_query_parameter).to eq('?url=www.google.com')
35
+ end
36
+ end
37
+
38
+ describe '#content_type' do
39
+ it 'returns text/plain' do
40
+ expect(link_shrink.content_type).to eq('text/plain')
41
+ end
42
+ end
43
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,35 @@
1
1
  require 'simplecov'
2
2
  require 'simplecov-gem-adapter'
3
+ require 'coveralls'
3
4
 
5
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
4
6
  SimpleCov.start 'gem'
7
+ require 'webmock/rspec'
8
+ require 'vcr'
5
9
  require 'shared_examples'
6
10
  require 'link_shrink'
7
11
 
12
+
13
+ VCR.configure do |c|
14
+ c.cassette_library_dir = 'spec/vcr_cassettes'
15
+ c.hook_into :webmock
16
+ c.default_cassette_options = {
17
+ record: :new_episodes
18
+ }
19
+ c.configure_rspec_metadata!
20
+ c.allow_http_connections_when_no_cassette = true
21
+ end
22
+
8
23
  RSpec.configure do |config|
9
- #config.treat_symbols_as_metadata_keys_with_true_values = true
24
+ config.treat_symbols_as_metadata_keys_with_true_values = true
10
25
  config.run_all_when_everything_filtered = true
11
26
  config.order = 'random'
12
27
  end
28
+
29
+ #before :each do
30
+ # VCR.use_cassette 'google_url' do
31
+ # LinkShrink.shrink_url('http://www.google.com')
32
+ # end
33
+ #end
34
+
35
+ #vcr_options = { :cassette_name => 'google_url', :record => :new_episodes }
@@ -0,0 +1,134 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyAygf2bk2L1QTGfOdQKQqnOzvlcFX4dmjY
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"longUrl":"http://www.google.com"}'
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - no-cache, no-store, max-age=0, must-revalidate
21
+ Pragma:
22
+ - no-cache
23
+ Expires:
24
+ - Fri, 01 Jan 1990 00:00:00 GMT
25
+ Date:
26
+ - Sun, 18 Aug 2013 09:43:44 GMT
27
+ Etag:
28
+ - ! '"7QRh0l_StuZTJyavuy4-STROp7U/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
29
+ Content-Type:
30
+ - application/json; charset=UTF-8
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ Server:
38
+ - GSE
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
44
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
45
+ http_version:
46
+ recorded_at: Sun, 18 Aug 2013 09:43:34 GMT
47
+ - request:
48
+ method: post
49
+ uri: https://www.googleapis.com/urlshortener/v1/url
50
+ body:
51
+ encoding: UTF-8
52
+ string: ! '{"longUrl":"http://www.google.com"}'
53
+ headers:
54
+ User-Agent:
55
+ - Typhoeus - https://github.com/typhoeus/typhoeus
56
+ Content-Type:
57
+ - application/json
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Cache-Control:
64
+ - no-cache, no-store, max-age=0, must-revalidate
65
+ Pragma:
66
+ - no-cache
67
+ Expires:
68
+ - Fri, 01 Jan 1990 00:00:00 GMT
69
+ Date:
70
+ - Wed, 28 Aug 2013 05:11:06 GMT
71
+ Etag:
72
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
73
+ Content-Type:
74
+ - application/json; charset=UTF-8
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ X-Xss-Protection:
80
+ - 1; mode=block
81
+ Server:
82
+ - GSE
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
88
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
89
+ http_version:
90
+ recorded_at: Wed, 28 Aug 2013 05:11:01 GMT
91
+ - request:
92
+ method: post
93
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=12345
94
+ body:
95
+ encoding: UTF-8
96
+ string: ! '{"longUrl":"http://www.google.com"}'
97
+ headers:
98
+ User-Agent:
99
+ - Typhoeus - https://github.com/typhoeus/typhoeus
100
+ Content-Type:
101
+ - application/json
102
+ response:
103
+ status:
104
+ code: 400
105
+ message: Bad Request
106
+ headers:
107
+ Content-Type:
108
+ - application/json; charset=UTF-8
109
+ Date:
110
+ - Fri, 06 Sep 2013 08:25:29 GMT
111
+ Expires:
112
+ - Fri, 06 Sep 2013 08:25:29 GMT
113
+ Cache-Control:
114
+ - private, max-age=0
115
+ X-Content-Type-Options:
116
+ - nosniff
117
+ X-Frame-Options:
118
+ - SAMEORIGIN
119
+ X-Xss-Protection:
120
+ - 1; mode=block
121
+ Server:
122
+ - GSE
123
+ Alternate-Protocol:
124
+ - 443:quic
125
+ Transfer-Encoding:
126
+ - chunked
127
+ body:
128
+ encoding: US-ASCII
129
+ string: ! "{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"usageLimits\",\n
130
+ \ \"reason\": \"keyInvalid\",\n \"message\": \"Bad Request\"\n }\n
131
+ \ ],\n \"code\": 400,\n \"message\": \"Bad Request\"\n }\n}\n"
132
+ http_version:
133
+ recorded_at: Fri, 06 Sep 2013 08:25:30 GMT
134
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyAygf2bk2L1QTGfOdQKQqnOzvlcFX4dmjY
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"longUrl":"http://www.google.com"}'
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - no-cache, no-store, max-age=0, must-revalidate
21
+ Pragma:
22
+ - no-cache
23
+ Expires:
24
+ - Fri, 01 Jan 1990 00:00:00 GMT
25
+ Date:
26
+ - Sun, 18 Aug 2013 09:43:45 GMT
27
+ Etag:
28
+ - ! '"7QRh0l_StuZTJyavuy4-STROp7U/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
29
+ Content-Type:
30
+ - application/json; charset=UTF-8
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ Server:
38
+ - GSE
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
44
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
45
+ http_version:
46
+ recorded_at: Sun, 18 Aug 2013 09:43:35 GMT
47
+ - request:
48
+ method: post
49
+ uri: https://www.googleapis.com/urlshortener/v1/url
50
+ body:
51
+ encoding: UTF-8
52
+ string: ! '{"longUrl":"http://www.google.com"}'
53
+ headers:
54
+ User-Agent:
55
+ - Typhoeus - https://github.com/typhoeus/typhoeus
56
+ Content-Type:
57
+ - application/json
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Cache-Control:
64
+ - no-cache, no-store, max-age=0, must-revalidate
65
+ Pragma:
66
+ - no-cache
67
+ Expires:
68
+ - Fri, 01 Jan 1990 00:00:00 GMT
69
+ Date:
70
+ - Wed, 28 Aug 2013 05:11:07 GMT
71
+ Etag:
72
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
73
+ Content-Type:
74
+ - application/json; charset=UTF-8
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ X-Xss-Protection:
80
+ - 1; mode=block
81
+ Server:
82
+ - GSE
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
88
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
89
+ http_version:
90
+ recorded_at: Wed, 28 Aug 2013 05:11:02 GMT
91
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyAygf2bk2L1QTGfOdQKQqnOzvlcFX4dmjY
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"longUrl":"http://www.google.com"}'
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - no-cache, no-store, max-age=0, must-revalidate
21
+ Pragma:
22
+ - no-cache
23
+ Expires:
24
+ - Fri, 01 Jan 1990 00:00:00 GMT
25
+ Date:
26
+ - Sun, 18 Aug 2013 09:43:46 GMT
27
+ Etag:
28
+ - ! '"7QRh0l_StuZTJyavuy4-STROp7U/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
29
+ Content-Type:
30
+ - application/json; charset=UTF-8
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ Server:
38
+ - GSE
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
44
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
45
+ http_version:
46
+ recorded_at: Sun, 18 Aug 2013 09:43:35 GMT
47
+ - request:
48
+ method: post
49
+ uri: https://www.googleapis.com/urlshortener/v1/url
50
+ body:
51
+ encoding: UTF-8
52
+ string: ! '{"longUrl":"http://www.google.com"}'
53
+ headers:
54
+ User-Agent:
55
+ - Typhoeus - https://github.com/typhoeus/typhoeus
56
+ Content-Type:
57
+ - application/json
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Cache-Control:
64
+ - no-cache, no-store, max-age=0, must-revalidate
65
+ Pragma:
66
+ - no-cache
67
+ Expires:
68
+ - Fri, 01 Jan 1990 00:00:00 GMT
69
+ Date:
70
+ - Wed, 28 Aug 2013 05:11:07 GMT
71
+ Etag:
72
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
73
+ Content-Type:
74
+ - application/json; charset=UTF-8
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ X-Xss-Protection:
80
+ - 1; mode=block
81
+ Server:
82
+ - GSE
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
88
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
89
+ http_version:
90
+ recorded_at: Wed, 28 Aug 2013 05:11:03 GMT
91
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyAygf2bk2L1QTGfOdQKQqnOzvlcFX4dmjY
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"longUrl":"http://www.google.com"}'
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - no-cache, no-store, max-age=0, must-revalidate
21
+ Pragma:
22
+ - no-cache
23
+ Expires:
24
+ - Fri, 01 Jan 1990 00:00:00 GMT
25
+ Date:
26
+ - Sun, 18 Aug 2013 09:43:46 GMT
27
+ Etag:
28
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
29
+ Content-Type:
30
+ - application/json; charset=UTF-8
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ Server:
38
+ - GSE
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
44
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
45
+ http_version:
46
+ recorded_at: Sun, 18 Aug 2013 09:43:36 GMT
47
+ - request:
48
+ method: post
49
+ uri: https://www.googleapis.com/urlshortener/v1/url
50
+ body:
51
+ encoding: UTF-8
52
+ string: ! '{"longUrl":"http://www.google.com"}'
53
+ headers:
54
+ User-Agent:
55
+ - Typhoeus - https://github.com/typhoeus/typhoeus
56
+ Content-Type:
57
+ - application/json
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Cache-Control:
64
+ - no-cache, no-store, max-age=0, must-revalidate
65
+ Pragma:
66
+ - no-cache
67
+ Expires:
68
+ - Fri, 01 Jan 1990 00:00:00 GMT
69
+ Date:
70
+ - Wed, 28 Aug 2013 05:11:07 GMT
71
+ Etag:
72
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
73
+ Content-Type:
74
+ - application/json; charset=UTF-8
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ X-Xss-Protection:
80
+ - 1; mode=block
81
+ Server:
82
+ - GSE
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
88
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
89
+ http_version:
90
+ recorded_at: Wed, 28 Aug 2013 05:11:03 GMT
91
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyAygf2bk2L1QTGfOdQKQqnOzvlcFX4dmjY
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"longUrl":"http://www.google.com"}'
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - no-cache, no-store, max-age=0, must-revalidate
21
+ Pragma:
22
+ - no-cache
23
+ Expires:
24
+ - Fri, 01 Jan 1990 00:00:00 GMT
25
+ Date:
26
+ - Sun, 18 Aug 2013 09:43:46 GMT
27
+ Etag:
28
+ - ! '"7QRh0l_StuZTJyavuy4-STROp7U/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
29
+ Content-Type:
30
+ - application/json; charset=UTF-8
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ Server:
38
+ - GSE
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
44
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
45
+ http_version:
46
+ recorded_at: Sun, 18 Aug 2013 09:43:36 GMT
47
+ - request:
48
+ method: post
49
+ uri: https://www.googleapis.com/urlshortener/v1/url
50
+ body:
51
+ encoding: UTF-8
52
+ string: ! '{"longUrl":"http://www.google.com"}'
53
+ headers:
54
+ User-Agent:
55
+ - Typhoeus - https://github.com/typhoeus/typhoeus
56
+ Content-Type:
57
+ - application/json
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Cache-Control:
64
+ - no-cache, no-store, max-age=0, must-revalidate
65
+ Pragma:
66
+ - no-cache
67
+ Expires:
68
+ - Fri, 01 Jan 1990 00:00:00 GMT
69
+ Date:
70
+ - Wed, 28 Aug 2013 05:11:08 GMT
71
+ Etag:
72
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
73
+ Content-Type:
74
+ - application/json; charset=UTF-8
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ X-Xss-Protection:
80
+ - 1; mode=block
81
+ Server:
82
+ - GSE
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
88
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
89
+ http_version:
90
+ recorded_at: Wed, 28 Aug 2013 05:11:03 GMT
91
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyAygf2bk2L1QTGfOdQKQqnOzvlcFX4dmjY
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"longUrl":"http://www.google.com"}'
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - no-cache, no-store, max-age=0, must-revalidate
21
+ Pragma:
22
+ - no-cache
23
+ Expires:
24
+ - Fri, 01 Jan 1990 00:00:00 GMT
25
+ Date:
26
+ - Sun, 18 Aug 2013 09:43:45 GMT
27
+ Etag:
28
+ - ! '"7QRh0l_StuZTJyavuy4-STROp7U/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
29
+ Content-Type:
30
+ - application/json; charset=UTF-8
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ Server:
38
+ - GSE
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
44
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
45
+ http_version:
46
+ recorded_at: Sun, 18 Aug 2013 09:43:35 GMT
47
+ - request:
48
+ method: post
49
+ uri: https://www.googleapis.com/urlshortener/v1/url
50
+ body:
51
+ encoding: UTF-8
52
+ string: ! '{"longUrl":"http://www.google.com"}'
53
+ headers:
54
+ User-Agent:
55
+ - Typhoeus - https://github.com/typhoeus/typhoeus
56
+ Content-Type:
57
+ - application/json
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Cache-Control:
64
+ - no-cache, no-store, max-age=0, must-revalidate
65
+ Pragma:
66
+ - no-cache
67
+ Expires:
68
+ - Fri, 01 Jan 1990 00:00:00 GMT
69
+ Date:
70
+ - Wed, 28 Aug 2013 05:11:06 GMT
71
+ Etag:
72
+ - ! '"xNgc-b3neWtxg-SZficvM7330kM/sJMG8iMchFaYf0TcrMJfiz7WfsI"'
73
+ Content-Type:
74
+ - application/json; charset=UTF-8
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ X-Xss-Protection:
80
+ - 1; mode=block
81
+ Server:
82
+ - GSE
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: US-ASCII
87
+ string: ! "{\n \"kind\": \"urlshortener#url\",\n \"id\": \"http://goo.gl/fbsS\",\n
88
+ \"longUrl\": \"http://www.google.com/\"\n}\n"
89
+ http_version:
90
+ recorded_at: Wed, 28 Aug 2013 05:11:02 GMT
91
+ recorded_with: VCR 2.5.0