pinterest-ruby 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.rubocop.yml +63 -0
  4. data/.travis-gemfile +17 -0
  5. data/.travis.yml +12 -0
  6. data/.yardopts +1 -0
  7. data/CHANGELOG.md +3 -0
  8. data/Gemfile +24 -0
  9. data/README.md +34 -0
  10. data/Rakefile +44 -0
  11. data/docs/FaradayMiddleware/SafeOj.html +218 -0
  12. data/docs/FaradayMiddleware.html +125 -0
  13. data/docs/Pinterest/Board.html +410 -0
  14. data/docs/Pinterest/Client.html +1894 -0
  15. data/docs/Pinterest/Collection.html +1877 -0
  16. data/docs/Pinterest/Endpoints/Authentication.html +578 -0
  17. data/docs/Pinterest/Endpoints/Boards.html +1443 -0
  18. data/docs/Pinterest/Endpoints/Pins.html +1296 -0
  19. data/docs/Pinterest/Endpoints/Users.html +1220 -0
  20. data/docs/Pinterest/Endpoints.html +127 -0
  21. data/docs/Pinterest/Entity.html +473 -0
  22. data/docs/Pinterest/Errors/AuthorizationError.html +158 -0
  23. data/docs/Pinterest/Errors/BadRequestError.html +158 -0
  24. data/docs/Pinterest/Errors/BaseError.html +487 -0
  25. data/docs/Pinterest/Errors/MethodNotAllowedError.html +158 -0
  26. data/docs/Pinterest/Errors/NotFoundError.html +158 -0
  27. data/docs/Pinterest/Errors/NotImplementedError.html +158 -0
  28. data/docs/Pinterest/Errors/PermissionsError.html +158 -0
  29. data/docs/Pinterest/Errors/RateLimitError.html +158 -0
  30. data/docs/Pinterest/Errors/ServerError.html +158 -0
  31. data/docs/Pinterest/Errors/TimeoutError.html +158 -0
  32. data/docs/Pinterest/Errors.html +377 -0
  33. data/docs/Pinterest/Image.html +617 -0
  34. data/docs/Pinterest/Interest.html +402 -0
  35. data/docs/Pinterest/Pin.html +511 -0
  36. data/docs/Pinterest/User.html +408 -0
  37. data/docs/Pinterest/Version.html +187 -0
  38. data/docs/Pinterest.html +130 -0
  39. data/docs/_index.html +401 -0
  40. data/docs/class_list.html +51 -0
  41. data/docs/css/common.css +1 -0
  42. data/docs/css/full_list.css +58 -0
  43. data/docs/css/style.css +492 -0
  44. data/docs/file.README.html +106 -0
  45. data/docs/file_list.html +56 -0
  46. data/docs/frames.html +17 -0
  47. data/docs/index.html +106 -0
  48. data/docs/js/app.js +243 -0
  49. data/docs/js/full_list.js +216 -0
  50. data/docs/js/jquery.js +4 -0
  51. data/docs/method_list.html +643 -0
  52. data/docs/top-level-namespace.html +110 -0
  53. data/lib/pinterest/client.rb +146 -0
  54. data/lib/pinterest/collection.rb +97 -0
  55. data/lib/pinterest/endpoints/authentication.rb +99 -0
  56. data/lib/pinterest/endpoints/boards.rb +193 -0
  57. data/lib/pinterest/endpoints/pins.rb +187 -0
  58. data/lib/pinterest/endpoints/users.rb +158 -0
  59. data/lib/pinterest/errors.rb +94 -0
  60. data/lib/pinterest/models/board.rb +34 -0
  61. data/lib/pinterest/models/entity.rb +42 -0
  62. data/lib/pinterest/models/image.rb +49 -0
  63. data/lib/pinterest/models/interest.rb +30 -0
  64. data/lib/pinterest/models/pin.rb +43 -0
  65. data/lib/pinterest/models/user.rb +33 -0
  66. data/lib/pinterest/safe_oj.rb +25 -0
  67. data/lib/pinterest/version.rb +23 -0
  68. data/lib/pinterest.rb +31 -0
  69. data/pinterest.gemspec +32 -0
  70. data/spec/cassettes/Pinterest_Client/_perform_network_request_private_/should_correctly_handle_malformed_requests.yml +51 -0
  71. data/spec/cassettes/Pinterest_Endpoints_Authentication/_fetch_access_token/should_make_the_call_to_Pinterest_and_return_the_authorization_token_also_saving_it.yml +58 -0
  72. data/spec/cassettes/Pinterest_Endpoints_Authentication/_verify_access_token/should_return_an_exception_when_using_an_invalid_token.yml +52 -0
  73. data/spec/cassettes/Pinterest_Endpoints_Authentication/_verify_access_token/should_verify_the_token.yml +59 -0
  74. data/spec/cassettes/Pinterest_Endpoints_Boards/_board/should_complain_for_invalid_boards.yml +48 -0
  75. data/spec/cassettes/Pinterest_Endpoints_Boards/_board/should_get_the_current_informations.yml +63 -0
  76. data/spec/cassettes/Pinterest_Endpoints_Boards/_board/should_restrict_to_requested_fields.yml +57 -0
  77. data/spec/cassettes/Pinterest_Endpoints_Boards/_boards/should_only_get_requested_fields.yml +57 -0
  78. data/spec/cassettes/Pinterest_Endpoints_Boards/_boards/should_return_a_list_of_boards.yml +74 -0
  79. data/spec/cassettes/Pinterest_Endpoints_Boards/_create_board/should_create_the_board_and_return_it_with_only_the_requested_fields.yml +56 -0
  80. data/spec/cassettes/Pinterest_Endpoints_Boards/_delete_board/should_perform_the_call_and_return_an_error.yml +48 -0
  81. data/spec/cassettes/Pinterest_Endpoints_Boards/_delete_board/should_perform_the_call_and_return_true.yml +109 -0
  82. data/spec/cassettes/Pinterest_Endpoints_Boards/_edit_board/should_edit_the_board_and_return_it_with_only_the_requested_fields.yml +56 -0
  83. data/spec/cassettes/Pinterest_Endpoints_Boards/_follow_board/should_complain_for_invalid_boards.yml +56 -0
  84. data/spec/cassettes/Pinterest_Endpoints_Boards/_follow_board/should_perform_the_call_and_return_true.yml +109 -0
  85. data/spec/cassettes/Pinterest_Endpoints_Boards/_following_boards/should_only_get_requested_fields.yml +59 -0
  86. data/spec/cassettes/Pinterest_Endpoints_Boards/_following_boards/should_paginate_correctly.yml +72 -0
  87. data/spec/cassettes/Pinterest_Endpoints_Boards/_following_boards/should_return_the_followed_boards.yml +72 -0
  88. data/spec/cassettes/Pinterest_Endpoints_Boards/_search_my_boards/should_only_get_requested_fields.yml +59 -0
  89. data/spec/cassettes/Pinterest_Endpoints_Boards/_search_my_boards/should_paginate_correctly.yml +66 -0
  90. data/spec/cassettes/Pinterest_Endpoints_Boards/_search_my_boards/should_search_boards.yml +75 -0
  91. data/spec/cassettes/Pinterest_Endpoints_Boards/_suggested_boards/should_return_the_suggested_boards_returning_only_the_requested_fields.yml +56 -0
  92. data/spec/cassettes/Pinterest_Endpoints_Boards/_unfollow_board/should_complain_for_invalid_boards.yml +56 -0
  93. data/spec/cassettes/Pinterest_Endpoints_Boards/_unfollow_board/should_perform_the_call_and_return_true.yml +109 -0
  94. data/spec/cassettes/Pinterest_Endpoints_Pins/_board_pins/should_only_get_requested_fields.yml +59 -0
  95. data/spec/cassettes/Pinterest_Endpoints_Pins/_board_pins/should_paginate_correctly.yml +85 -0
  96. data/spec/cassettes/Pinterest_Endpoints_Pins/_board_pins/should_return_the_pins_of_the_board.yml +85 -0
  97. data/spec/cassettes/Pinterest_Endpoints_Pins/_create_pin/should_create_a_pin_by_using_a_image_URL.yml +71 -0
  98. data/spec/cassettes/Pinterest_Endpoints_Pins/_create_pin/should_create_a_pin_by_using_a_image_file.yml +1997 -0
  99. data/spec/cassettes/Pinterest_Endpoints_Pins/_create_pin/should_return_a_pin_containing_only_requested_fields.yml +56 -0
  100. data/spec/cassettes/Pinterest_Endpoints_Pins/_delete_pin/should_perform_the_call_and_return_an_error.yml +56 -0
  101. data/spec/cassettes/Pinterest_Endpoints_Pins/_delete_pin/should_perform_the_call_and_return_true.yml +109 -0
  102. data/spec/cassettes/Pinterest_Endpoints_Pins/_edit_pin/should_edit_the_pin_and_return_it_with_only_the_requested_fields.yml +56 -0
  103. data/spec/cassettes/Pinterest_Endpoints_Pins/_likes/should_only_get_requested_fields.yml +58 -0
  104. data/spec/cassettes/Pinterest_Endpoints_Pins/_likes/should_paginate_correctly.yml +87 -0
  105. data/spec/cassettes/Pinterest_Endpoints_Pins/_likes/should_return_the_list_of_liked_pins.yml +85 -0
  106. data/spec/cassettes/Pinterest_Endpoints_Pins/_pin/should_complain_for_non_existent_pins.yml +56 -0
  107. data/spec/cassettes/Pinterest_Endpoints_Pins/_pin/should_get_the_current_informations.yml +71 -0
  108. data/spec/cassettes/Pinterest_Endpoints_Pins/_pin/should_restrict_to_requested_fields.yml +56 -0
  109. data/spec/cassettes/Pinterest_Endpoints_Pins/_pins/should_only_get_requested_fields.yml +59 -0
  110. data/spec/cassettes/Pinterest_Endpoints_Pins/_pins/should_paginate_correctly.yml +808 -0
  111. data/spec/cassettes/Pinterest_Endpoints_Pins/_pins/should_return_my_pins.yml +88 -0
  112. data/spec/cassettes/Pinterest_Endpoints_Pins/_search_my_pins/should_only_get_requested_fields.yml +61 -0
  113. data/spec/cassettes/Pinterest_Endpoints_Pins/_search_my_pins/should_paginate_correctly.yml +89 -0
  114. data/spec/cassettes/Pinterest_Endpoints_Pins/_search_my_pins/should_search_my_pins.yml +89 -0
  115. data/spec/cassettes/Pinterest_Endpoints_Users/_follow_interest/should_perform_the_call_and_return_an_error.yml +48 -0
  116. data/spec/cassettes/Pinterest_Endpoints_Users/_follow_user/should_complain_for_invalid_users.yml +56 -0
  117. data/spec/cassettes/Pinterest_Endpoints_Users/_follow_user/should_perform_the_call_and_return_true.yml +109 -0
  118. data/spec/cassettes/Pinterest_Endpoints_Users/_followers/should_only_get_requested_fields.yml +62 -0
  119. data/spec/cassettes/Pinterest_Endpoints_Users/_followers/should_paginate_correctly.yml +62 -0
  120. data/spec/cassettes/Pinterest_Endpoints_Users/_followers/should_return_a_list_of_followers.yml +62 -0
  121. data/spec/cassettes/Pinterest_Endpoints_Users/_following_users/should_only_get_requested_fields.yml +62 -0
  122. data/spec/cassettes/Pinterest_Endpoints_Users/_following_users/should_paginate_correctly.yml +131 -0
  123. data/spec/cassettes/Pinterest_Endpoints_Users/_following_users/should_return_a_list_of_followed_users.yml +66 -0
  124. data/spec/cassettes/Pinterest_Endpoints_Users/_interests/should_paginate_correctly.yml +112 -0
  125. data/spec/cassettes/Pinterest_Endpoints_Users/_interests/should_return_a_list_of_followed_interest.yml +58 -0
  126. data/spec/cassettes/Pinterest_Endpoints_Users/_me/should_get_the_current_informations.yml +62 -0
  127. data/spec/cassettes/Pinterest_Endpoints_Users/_me/should_restrict_to_requested_fields.yml +56 -0
  128. data/spec/cassettes/Pinterest_Endpoints_Users/_unfollow_interest/should_perform_the_call_and_return_an_error.yml +48 -0
  129. data/spec/cassettes/Pinterest_Endpoints_Users/_unfollow_user/should_complain_for_invalid_users.yml +56 -0
  130. data/spec/cassettes/Pinterest_Endpoints_Users/_unfollow_user/should_perform_the_call_and_return_true.yml +109 -0
  131. data/spec/cassettes/Pinterest_Endpoints_Users/_user/should_complain_for_non_existent_users.yml +56 -0
  132. data/spec/cassettes/Pinterest_Endpoints_Users/_user/should_get_the_current_informations.yml +60 -0
  133. data/spec/cassettes/Pinterest_Endpoints_Users/_user/should_restrict_to_requested_fields.yml +56 -0
  134. data/spec/pinterest/client_spec.rb +70 -0
  135. data/spec/pinterest/collection_spec.rb +82 -0
  136. data/spec/pinterest/endpoints/authentication_spec.rb +81 -0
  137. data/spec/pinterest/endpoints/boards_spec.rb +209 -0
  138. data/spec/pinterest/endpoints/pins_spec.rb +239 -0
  139. data/spec/pinterest/endpoints/users_spec.rb +194 -0
  140. data/spec/pinterest/errors_spec.rb +59 -0
  141. data/spec/pinterest/fixtures/first.jpg +0 -0
  142. data/spec/pinterest/models/board_spec.rb +48 -0
  143. data/spec/pinterest/models/entity_spec.rb +35 -0
  144. data/spec/pinterest/models/image_spec.rb +50 -0
  145. data/spec/pinterest/models/interest_spec.rb +20 -0
  146. data/spec/pinterest/models/pin_spec.rb +55 -0
  147. data/spec/pinterest/models/user_spec.rb +45 -0
  148. data/spec/spec_helper.rb +49 -0
  149. data/tester.rb +19 -0
  150. metadata +341 -0
@@ -0,0 +1,25 @@
1
+ #
2
+ # This file is part of the pinterest-ruby gem. Copyright (C) 2017 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ # :nodoc:
7
+ module FaradayMiddleware
8
+ # :nodoc:
9
+ class SafeOj < ::FaradayMiddleware::ResponseMiddleware
10
+ dependency "oj"
11
+
12
+ define_parser do |body|
13
+ body.strip.empty? ? nil : Oj.load(body, mode: :compat, symbol_keys: false)
14
+ end
15
+
16
+ # :nodoc:
17
+ def process_response(env)
18
+ super(env)
19
+ rescue Faraday::Error::ParsingError => err
20
+ raise(Faraday::Error::ParsingError.new(err.instance_variable_get(:@wrapped_exception), env))
21
+ end
22
+ end
23
+ end
24
+
25
+ Faraday::Response.register_middleware safe_oj: FaradayMiddleware::SafeOj
@@ -0,0 +1,23 @@
1
+ #
2
+ # This file is part of the pinterest-ruby gem. Copyright (C) 2017 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ module Pinterest
7
+ # The current version of pinterest-ruby, according to semantic versioning.
8
+ #
9
+ # @see http://semver.org
10
+ module Version
11
+ # The major version.
12
+ MAJOR = 1
13
+
14
+ # The minor version.
15
+ MINOR = 0
16
+
17
+ # The patch version.
18
+ PATCH = 0
19
+
20
+ # The current version of pinterest-ruby.
21
+ STRING = [MAJOR, MINOR, PATCH].compact.join(".")
22
+ end
23
+ end
data/lib/pinterest.rb ADDED
@@ -0,0 +1,31 @@
1
+ #
2
+ # This file is part of the pinterest-ruby gem. Copyright (C) 2017 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ require "securerandom"
7
+ require "addressable/uri"
8
+ require "oj"
9
+ require "faraday"
10
+ require "faraday_middleware"
11
+ require "faraday_middleware/response_middleware"
12
+ require "fastimage"
13
+
14
+ require "pinterest/version" unless defined?(Pinterest::Version)
15
+ require "pinterest/errors"
16
+ require "pinterest/collection"
17
+
18
+ require "pinterest/models/entity"
19
+ require "pinterest/models/interest"
20
+ require "pinterest/models/image"
21
+ require "pinterest/models/user"
22
+ require "pinterest/models/board"
23
+ require "pinterest/models/pin"
24
+
25
+ require "pinterest/endpoints/authentication"
26
+ require "pinterest/endpoints/users"
27
+ require "pinterest/endpoints/pins"
28
+ require "pinterest/endpoints/boards"
29
+
30
+ require "pinterest/safe_oj"
31
+ require "pinterest/client"
data/pinterest.gemspec ADDED
@@ -0,0 +1,32 @@
1
+ #
2
+ # This file is part of the pinterest-ruby gem. Copyright (C) 2017 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ require File.expand_path("../lib/pinterest/version", __FILE__)
7
+
8
+ Gem::Specification.new do |gem|
9
+ gem.name = "pinterest-ruby"
10
+ gem.version = Pinterest::Version::STRING
11
+ gem.homepage = "https://github.com/ShogunPanda/pinterest-ruby"
12
+ gem.summary = "Pinterest API wrapper for Ruby."
13
+ gem.description = "Pinterest API wrapper for Ruby."
14
+ gem.rubyforge_project = "pinterest-ruby"
15
+
16
+ gem.authors = ["Shogun"]
17
+ gem.email = ["shogun@cowtech.it"]
18
+ gem.license = "MIT"
19
+
20
+ gem.files = `git ls-files`.split($\)
21
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
22
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
23
+ gem.require_paths = ["lib"]
24
+
25
+ gem.required_ruby_version = ">= 2.2"
26
+
27
+ gem.add_dependency("addressable", "~> 2.5")
28
+ gem.add_dependency("faraday", "~> 0.10")
29
+ gem.add_dependency("faraday_middleware", "~> 0.10")
30
+ gem.add_dependency("fastimage", "~> 2.0")
31
+ gem.add_dependency("oj", "~> 2.18")
32
+ end
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/foo
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: NOT FOUND
24
+ headers:
25
+ Age:
26
+ - '0'
27
+ Cache-Control:
28
+ - private
29
+ Content-Type:
30
+ - application/json
31
+ Pinterest-Generated-By:
32
+ - coreapp-ngapi-prod-0a0184f2
33
+ - coreapp-ngapi-prod-0a0184f2
34
+ Pinterest-Version:
35
+ - 04bc94f
36
+ X-Content-Type-Options:
37
+ - nosniff
38
+ X-Pinterest-Rid:
39
+ - '472656101368'
40
+ Content-Length:
41
+ - '173'
42
+ Date:
43
+ - Thu, 12 Jan 2017 11:48:45 GMT
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: UTF-8
48
+ string: 'INVALID JSON'
49
+ http_version:
50
+ recorded_at: Thu, 12 Jan 2017 11:48:45 GMT
51
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.pinterest.com/v1/oauth/token?client_id=4878490596204882047&client_secret=aaa4922dadd0a08b0d767df5263e2e8987f88faa16c4079e17c10c0447c0fce0&code=9568cec6cc78aa05&grant_type=authorization_code
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ Age:
28
+ - '0'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - application/json
33
+ Pinterest-Generated-By:
34
+ - None
35
+ Pinterest-Version:
36
+ - d67cb4f
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ X-Pinterest-Rid:
40
+ - '694685527117'
41
+ X-Ratelimit-Limit:
42
+ - '500'
43
+ X-Ratelimit-Remaining:
44
+ - '496'
45
+ Content-Length:
46
+ - '237'
47
+ Date:
48
+ - Thu, 12 Jan 2017 11:46:45 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"access_token": "AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA",
54
+ "token_type": "bearer", "scope": ["read_public", "write_public", "read_private",
55
+ "write_private", "read_relationships", "write_relationships", "read_write_all"]}'
56
+ http_version:
57
+ recorded_at: Thu, 12 Jan 2017 11:46:45 GMT
58
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/oauth/inspect
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer A
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 401
23
+ message: UNAUTHORIZED
24
+ headers:
25
+ Age:
26
+ - '0'
27
+ Cache-Control:
28
+ - private
29
+ Content-Type:
30
+ - application/json
31
+ Pinterest-Generated-By:
32
+ - devplatform-devapi-prod-0a01c01e
33
+ Pinterest-Version:
34
+ - d67cb4f
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Pinterest-Rid:
38
+ - '308104637921'
39
+ Content-Length:
40
+ - '177'
41
+ Date:
42
+ - Thu, 12 Jan 2017 11:46:46 GMT
43
+ Connection:
44
+ - keep-alive
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"status": "failure", "code": 3, "host": "devplatform-devapi-prod-0a01c01e",
48
+ "generated_at": "Thu, 12 Jan 2017 11:46:46 +0000", "message": "Authorization
49
+ failed.", "data": null}'
50
+ http_version:
51
+ recorded_at: Thu, 12 Jan 2017 11:46:46 GMT
52
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/oauth/inspect
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ Age:
28
+ - '0'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - application/json
33
+ Pinterest-Generated-By:
34
+ - None
35
+ Pinterest-Version:
36
+ - d67cb4f
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ X-Pinterest-Rid:
40
+ - '441010344100'
41
+ X-Ratelimit-Limit:
42
+ - '200'
43
+ X-Ratelimit-Remaining:
44
+ - '197'
45
+ Content-Length:
46
+ - '251'
47
+ Date:
48
+ - Thu, 12 Jan 2017 11:46:46 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"data": {"issued_at": "2017-01-12T11:44:40", "scopes": ["read_public",
54
+ "write_public", "read_relationships", "write_relationships"], "app": {"state":
55
+ "UNKNOWN", "id": 4878490596204882047, "name": "Pinterest Ruby Gem"}, "user_id":
56
+ 559853934835925315}}'
57
+ http_version:
58
+ recorded_at: Thu, 12 Jan 2017 11:46:46 GMT
59
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/boards/invalid-board/?fields=id,name,url,description,creator(id,username,first_name,last_name,bio,created_at,counts,image),created_at,counts,image
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: NOT FOUND
24
+ headers:
25
+ Age:
26
+ - '0'
27
+ Cache-Control:
28
+ - private
29
+ Content-Type:
30
+ - application/json
31
+ X-Pinterest-Rid:
32
+ - '156230424132'
33
+ Content-Length:
34
+ - '51'
35
+ Date:
36
+ - Thu, 12 Jan 2017 12:13:20 GMT
37
+ Connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: UTF-8
41
+ string: |-
42
+ {
43
+ "message": "404: Not Found",
44
+ "type": "http"
45
+ }
46
+ http_version:
47
+ recorded_at: Thu, 12 Jan 2017 12:13:20 GMT
48
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/boards/491736921752475493/?fields=id,name,url,description,creator(id,username,first_name,last_name,bio,created_at,counts,image),created_at,counts,image
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ Age:
28
+ - '0'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - application/json
33
+ Pinterest-Generated-By:
34
+ - None
35
+ Pinterest-Version:
36
+ - d67cb4f
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ X-Pinterest-Rid:
40
+ - '698185498498'
41
+ X-Ratelimit-Limit:
42
+ - '200'
43
+ X-Ratelimit-Remaining:
44
+ - '125'
45
+ Content-Length:
46
+ - '764'
47
+ Date:
48
+ - Thu, 12 Jan 2017 12:13:19 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"data": {"description": "", "creator": {"username": "dderse", "bio":
54
+ "", "first_name": "Daniel", "last_name": "Derse", "created_at": "2012-09-03T13:21:48",
55
+ "image": {"60x60": {"url": "https://s-media-cache-ak0.pinimg.com/avatars/dderse_1477012877_60.jpg",
56
+ "width": 60, "height": 60}}, "counts": {"pins": 23400, "following": 691, "followers":
57
+ 13079, "boards": 37, "likes": 35}, "id": "491736990471948025"}, "url": "https://www.pinterest.com/dderse/woodworking/",
58
+ "created_at": "2012-09-15T14:10:33", "image": {"60x60": {"url": "https://s-media-cache-ak0.pinimg.com/60x60/8f/a3/01/8fa3011c924838a3afe246419486dde3.jpg",
59
+ "width": 60, "height": 60}}, "counts": {"pins": 3423, "collaborators": 0,
60
+ "followers": 7618}, "id": "491736921752475493", "name": "Woodworking"}}'
61
+ http_version:
62
+ recorded_at: Thu, 12 Jan 2017 12:13:19 GMT
63
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/boards/491736921752475493/?fields=url
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ Age:
28
+ - '0'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - application/json
33
+ Pinterest-Generated-By:
34
+ - None
35
+ Pinterest-Version:
36
+ - d67cb4f
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ X-Pinterest-Rid:
40
+ - '986118702376'
41
+ X-Ratelimit-Limit:
42
+ - '200'
43
+ X-Ratelimit-Remaining:
44
+ - '124'
45
+ Content-Length:
46
+ - '94'
47
+ Date:
48
+ - Thu, 12 Jan 2017 12:13:20 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"data": {"url": "https://www.pinterest.com/dderse/woodworking/", "id":
54
+ "491736921752475493"}}'
55
+ http_version:
56
+ recorded_at: Thu, 12 Jan 2017 12:13:20 GMT
57
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/me/boards/?fields=name
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ Age:
28
+ - '0'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - application/json
33
+ Pinterest-Generated-By:
34
+ - None
35
+ Pinterest-Version:
36
+ - d67cb4f
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ X-Pinterest-Rid:
40
+ - '493123612079'
41
+ X-Ratelimit-Limit:
42
+ - '200'
43
+ X-Ratelimit-Remaining:
44
+ - '122'
45
+ Content-Length:
46
+ - '110'
47
+ Date:
48
+ - Thu, 12 Jan 2017 12:13:21 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"data": [{"id": "559853866116513386", "name": "9GAG"}, {"id": "559853866116479541",
54
+ "name": "Social & Web"}]}'
55
+ http_version:
56
+ recorded_at: Thu, 12 Jan 2017 12:13:21 GMT
57
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,74 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.pinterest.com/v1/me/boards/?fields=id,name,url,description,creator(id,username,first_name,last_name,bio,created_at,counts,image),created_at,counts,image
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.1
12
+ Authorization:
13
+ - Bearer AVP99QpzwII-f1I2p5gyHi8CiCeQFJkDr8dP-JpDs-LEtAAyegAAAAA
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - "*"
27
+ Age:
28
+ - '0'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - application/json
33
+ Pinterest-Generated-By:
34
+ - None
35
+ Pinterest-Version:
36
+ - d67cb4f
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ X-Pinterest-Rid:
40
+ - '468839482991'
41
+ X-Ratelimit-Limit:
42
+ - '200'
43
+ X-Ratelimit-Remaining:
44
+ - '123'
45
+ Transfer-Encoding:
46
+ - chunked
47
+ Date:
48
+ - Thu, 12 Jan 2017 12:13:20 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: ASCII-8BIT
53
+ string: '{"data": [{"description": "The most stupid things by 9GAG.", "creator":
54
+ {"username": "shogunpanda", "bio": "Senior developer in Ruby on Rails, jQuery,
55
+ HTML5, CSS3, BootStrap, Backbone.JS and others. LARV addicted and nerd on
56
+ many things. From Molise, Italy.", "first_name": "Paolo", "last_name": "Insogna",
57
+ "created_at": "2012-08-12T06:28:34", "image": {"60x60": {"url": "https://s-media-cache-ak0.pinimg.com/avatars/shogunpanda_1344752914_60.jpg",
58
+ "width": 60, "height": 60}}, "counts": {"pins": 46, "following": 8, "followers":
59
+ 9, "boards": 2, "likes": 1}, "id": "559853934835925315"}, "url": "https://www.pinterest.com/shogunpanda/9gag/",
60
+ "created_at": "2013-09-02T16:44:49", "image": {"60x60": {"url": "https://s-media-cache-ak0.pinimg.com/60x60/86/28/87/862887a3bfdd437a0b898571485ff570.jpg",
61
+ "width": 60, "height": 60}}, "counts": {"pins": 44, "collaborators": 0, "followers":
62
+ 9}, "id": "559853866116513386", "name": "9GAG"}, {"description": "", "creator":
63
+ {"username": "shogunpanda", "bio": "Senior developer in Ruby on Rails, jQuery,
64
+ HTML5, CSS3, BootStrap, Backbone.JS and others. LARV addicted and nerd on
65
+ many things. From Molise, Italy.", "first_name": "Paolo", "last_name": "Insogna",
66
+ "created_at": "2012-08-12T06:28:34", "image": {"60x60": {"url": "https://s-media-cache-ak0.pinimg.com/avatars/shogunpanda_1344752914_60.jpg",
67
+ "width": 60, "height": 60}}, "counts": {"pins": 46, "following": 8, "followers":
68
+ 9, "boards": 2, "likes": 1}, "id": "559853934835925315"}, "url": "https://www.pinterest.com/shogunpanda/social-web/",
69
+ "created_at": "2013-02-03T19:10:48", "image": {"60x60": {"url": "https://s-media-cache-ak0.pinimg.com/60x60/3e/57/7c/3e577c0491d28a0cd5c662ca1ed5a203.jpg",
70
+ "width": 60, "height": 60}}, "counts": {"pins": 2, "collaborators": 0, "followers":
71
+ 8}, "id": "559853866116479541", "name": "Social & Web"}]}'
72
+ http_version:
73
+ recorded_at: Thu, 12 Jan 2017 12:13:20 GMT
74
+ recorded_with: VCR 3.0.3