aylien_text_api 0.0.1

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 (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +3 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +28 -0
  5. data/LICENSE +13 -0
  6. data/README.md +67 -0
  7. data/Rakefile +8 -0
  8. data/aylien_text_api.gemspec +24 -0
  9. data/config/app_config.yml.example +7 -0
  10. data/lib/aylien_text_api.rb +23 -0
  11. data/lib/aylien_text_api/client.rb +246 -0
  12. data/lib/aylien_text_api/configuration.rb +57 -0
  13. data/lib/aylien_text_api/connection.rb +71 -0
  14. data/lib/aylien_text_api/error.rb +110 -0
  15. data/lib/aylien_text_api/version.rb +17 -0
  16. data/spec/fixtures/aylien_text_api/client/classify_with_invalid_client.yml +36 -0
  17. data/spec/fixtures/aylien_text_api/client/classify_with_invalid_params.yml +40 -0
  18. data/spec/fixtures/aylien_text_api/client/classify_with_text.yml +48 -0
  19. data/spec/fixtures/aylien_text_api/client/classify_with_unauthenticated_client.yml +40 -0
  20. data/spec/fixtures/aylien_text_api/client/classify_with_valid_url.yml +98 -0
  21. data/spec/fixtures/aylien_text_api/client/classify_with_value_as_text.yml +48 -0
  22. data/spec/fixtures/aylien_text_api/client/classify_with_value_as_valid_url.yml +98 -0
  23. data/spec/fixtures/aylien_text_api/client/concepts_with_invalid_client.yml +36 -0
  24. data/spec/fixtures/aylien_text_api/client/concepts_with_invalid_params.yml +40 -0
  25. data/spec/fixtures/aylien_text_api/client/concepts_with_text.yml +44 -0
  26. data/spec/fixtures/aylien_text_api/client/concepts_with_unauthenticated_client.yml +40 -0
  27. data/spec/fixtures/aylien_text_api/client/concepts_with_valid_url.yml +63 -0
  28. data/spec/fixtures/aylien_text_api/client/concepts_with_value_as_text.yml +44 -0
  29. data/spec/fixtures/aylien_text_api/client/concepts_with_value_as_valid_url.yml +63 -0
  30. data/spec/fixtures/aylien_text_api/client/entities_with_invalid_client.yml +36 -0
  31. data/spec/fixtures/aylien_text_api/client/entities_with_invalid_params.yml +40 -0
  32. data/spec/fixtures/aylien_text_api/client/entities_with_text.yml +43 -0
  33. data/spec/fixtures/aylien_text_api/client/entities_with_unauthenticated_client.yml +40 -0
  34. data/spec/fixtures/aylien_text_api/client/entities_with_valid_url.yml +302 -0
  35. data/spec/fixtures/aylien_text_api/client/entities_with_value_as_text.yml +43 -0
  36. data/spec/fixtures/aylien_text_api/client/entities_with_value_as_valid_url.yml +302 -0
  37. data/spec/fixtures/aylien_text_api/client/extract_with_invalid_client.yml +36 -0
  38. data/spec/fixtures/aylien_text_api/client/extract_with_invalid_params.yml +40 -0
  39. data/spec/fixtures/aylien_text_api/client/extract_with_unauthenticated_client.yml +40 -0
  40. data/spec/fixtures/aylien_text_api/client/extract_with_valid_url.yml +185 -0
  41. data/spec/fixtures/aylien_text_api/client/extract_with_value_as_text.yml +40 -0
  42. data/spec/fixtures/aylien_text_api/client/extract_with_value_as_valid_url.yml +185 -0
  43. data/spec/fixtures/aylien_text_api/client/hashtags_with_invalid_client.yml +36 -0
  44. data/spec/fixtures/aylien_text_api/client/hashtags_with_invalid_params.yml +40 -0
  45. data/spec/fixtures/aylien_text_api/client/hashtags_with_text.yml +48 -0
  46. data/spec/fixtures/aylien_text_api/client/hashtags_with_unauthenticated_client.yml +40 -0
  47. data/spec/fixtures/aylien_text_api/client/hashtags_with_valid_url.yml +58 -0
  48. data/spec/fixtures/aylien_text_api/client/hashtags_with_value_as_text.yml +48 -0
  49. data/spec/fixtures/aylien_text_api/client/hashtags_with_value_as_valid_url.yml +58 -0
  50. data/spec/fixtures/aylien_text_api/client/language_with_invalid_client.yml +36 -0
  51. data/spec/fixtures/aylien_text_api/client/language_with_invalid_params.yml +40 -0
  52. data/spec/fixtures/aylien_text_api/client/language_with_unauthenticated_client.yml +40 -0
  53. data/spec/fixtures/aylien_text_api/client/language_with_valid_text.yml +41 -0
  54. data/spec/fixtures/aylien_text_api/client/language_with_valid_url.yml +57 -0
  55. data/spec/fixtures/aylien_text_api/client/language_with_value_as_text.yml +41 -0
  56. data/spec/fixtures/aylien_text_api/client/language_with_value_as_valid_url.yml +57 -0
  57. data/spec/fixtures/aylien_text_api/client/related_with_invalid_client.yml +36 -0
  58. data/spec/fixtures/aylien_text_api/client/related_with_invalid_params.yml +40 -0
  59. data/spec/fixtures/aylien_text_api/client/related_with_phrase.yml +60 -0
  60. data/spec/fixtures/aylien_text_api/client/related_with_unauthenticated_client.yml +40 -0
  61. data/spec/fixtures/aylien_text_api/client/related_with_value_as_phrase.yml +60 -0
  62. data/spec/fixtures/aylien_text_api/client/related_with_value_as_valid_url.yml +40 -0
  63. data/spec/fixtures/aylien_text_api/client/sentiment_with_invalid_client.yml +36 -0
  64. data/spec/fixtures/aylien_text_api/client/sentiment_with_invalid_params.yml +40 -0
  65. data/spec/fixtures/aylien_text_api/client/sentiment_with_text.yml +53 -0
  66. data/spec/fixtures/aylien_text_api/client/sentiment_with_unauthenticated_client.yml +40 -0
  67. data/spec/fixtures/aylien_text_api/client/sentiment_with_valid_url.yml +57 -0
  68. data/spec/fixtures/aylien_text_api/client/sentiment_with_value_as_text.yml +53 -0
  69. data/spec/fixtures/aylien_text_api/client/sentiment_with_value_as_valid_url.yml +57 -0
  70. data/spec/fixtures/aylien_text_api/client/summarize_with_invalid_client.yml +36 -0
  71. data/spec/fixtures/aylien_text_api/client/summarize_with_invalid_params.yml +41 -0
  72. data/spec/fixtures/aylien_text_api/client/summarize_with_title_and_text.yml +78 -0
  73. data/spec/fixtures/aylien_text_api/client/summarize_with_unauthenticated_client.yml +40 -0
  74. data/spec/fixtures/aylien_text_api/client/summarize_with_valid_url.yml +65 -0
  75. data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_title.yml +78 -0
  76. data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_without_title.yml +41 -0
  77. data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_valid_url.yml +65 -0
  78. data/spec/lib/aylien_text_api/classify.rb +86 -0
  79. data/spec/lib/aylien_text_api/client_spec.rb +23 -0
  80. data/spec/lib/aylien_text_api/concepts.rb +81 -0
  81. data/spec/lib/aylien_text_api/entities.rb +81 -0
  82. data/spec/lib/aylien_text_api/extract.rb +81 -0
  83. data/spec/lib/aylien_text_api/hashtags.rb +87 -0
  84. data/spec/lib/aylien_text_api/language.rb +79 -0
  85. data/spec/lib/aylien_text_api/related.rb +80 -0
  86. data/spec/lib/aylien_text_api/sentiment.rb +91 -0
  87. data/spec/lib/aylien_text_api/summarize.rb +95 -0
  88. data/spec/spec_helper.rb +16 -0
  89. metadata +193 -0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/hashtags
6
+ body:
7
+ encoding: US-ASCII
8
+ string: wrong_param=The+Google+Cast+SDK+is+simple+to+integrate+because+there%E2%80%99s+no%0A++++++need+to+write+a+new+app.+Just+incorporate+the+SDK+into+your+existing%0A++++++mobile+and+web+apps+to+bring+your+content+to+the+TV.+You+are+in%0A++++++control+of+how+and+when+you+develop+and+publish+your+cast-ready%0A++++++apps+through+the+Google+Cast+developer+console.%0A++++++The+SDK+is+available+on+Android+and+iOS+as+well+as+on+Chrome%0A++++++through+the+Google+Cast+browser+extension.
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 400
23
+ message: Bad Request
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:41 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '70'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! '{"error" : "requirement failed: you must either provide url or text."}'
38
+ http_version:
39
+ recorded_at: Tue, 02 Dec 2014 18:15:39 GMT
40
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/hashtags
6
+ body:
7
+ encoding: US-ASCII
8
+ string: text=The+Google+Cast+SDK+is+simple+to+integrate+because+there%E2%80%99s+no%0A++++++need+to+write+a+new+app.+Just+incorporate+the+SDK+into+your+existing%0A++++++mobile+and+web+apps+to+bring+your+content+to+the+TV.+You+are+in%0A++++++control+of+how+and+when+you+develop+and+publish+your+cast-ready%0A++++++apps+through+the+Google+Cast+developer+console.%0A++++++The+SDK+is+available+on+Android+and+iOS+as+well+as+on+Chrome%0A++++++through+the+Google+Cast+browser+extension.
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:43 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '615'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! "{\n \"text\": \"The Google Cast SDK is simple to integrate because
38
+ there\\u2019s no\\n need to write a new app. Just incorporate the SDK
39
+ into your existing\\n mobile and web apps to bring your content to the
40
+ TV. You are in\\n control of how and when you develop and publish your
41
+ cast-ready\\n apps through the Google Cast developer console.\\n The
42
+ SDK is available on Android and iOS as well as on Chrome\\n through the
43
+ Google Cast browser extension.\",\n \"language\": \"en\",\n \"hashtags\":
44
+ [\"#SoftwareDevelopmentKit\", \"#SDK\", \"#Google\", \"#BrowserExtension\",
45
+ \"#Android\", \"#IOS\", \"#WebApplication\"]\n}"
46
+ http_version:
47
+ recorded_at: Tue, 02 Dec 2014 18:15:40 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/hashtags
6
+ body:
7
+ encoding: US-ASCII
8
+ string: text=The+Google+Cast+SDK+is+simple+to+integrate+because+there%E2%80%99s+no%0A++++++need+to+write+a+new+app.+Just+incorporate+the+SDK+into+your+existing%0A++++++mobile+and+web+apps+to+bring+your+content+to+the+TV.+You+are+in%0A++++++control+of+how+and+when+you+develop+and+publish+your+cast-ready%0A++++++apps+through+the+Google+Cast+developer+console.%0A++++++The+SDK+is+available+on+Android+and+iOS+as+well+as+on+Chrome%0A++++++through+the+Google+Cast+browser+extension.
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - random_string
18
+ App-Key:
19
+ - random_string
20
+ response:
21
+ status:
22
+ code: 403
23
+ message: Forbidden
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:44 GMT
29
+ Content-Type:
30
+ - text/plain; charset=us-ascii
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: Authentication failed
38
+ http_version:
39
+ recorded_at: Tue, 02 Dec 2014 18:15:41 GMT
40
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/hashtags
6
+ body:
7
+ encoding: US-ASCII
8
+ string: url=http%3A%2F%2Fwww.bbc.com%2Fsport%2F0%2Ffootball%2F25912393
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:39 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '1421'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! "{\n \"text\": \"Lionel Messi: Forward is not for sale, says Barcelona
38
+ president\\nLionel Messi: Forward is not for sale, says Barcelona president\\n\\nBarcelona
39
+ forward Lionel Messi is not for sale and the club plan to discuss a new contract
40
+ with the Argentine, says president Josep Maria Bartomeu.\\n\\nFour-time Ballon
41
+ d'Or winner Messi, 26, is reported to be a\\n\\nIn an interview with radio
42
+ station RAC1, Bartomeu said: \\\"The club will sit down and negotiate a new
43
+ contract.\\n\\n\\\"We will do what we have to, to ensure he's the best-paid
44
+ player.\\\"\\n\\nMessi scored 60 goals in 50 appearances last season but has
45
+ struggled to match that goalscoring form in 2013-14.\\n\\nHe has scored 18
46
+ goals so far but just eight of those have been in the league.\\n\\nHis last
47
+ league goal came in September, before he was out for five weeks with a hamstring
48
+ injury.\\n\\n\\\"He can do everything,\\\" said Barca coach Gerardo Martino.
49
+ \\\"If he succeeds in other facets of his game, it doesn't matter if he scores.\\n\\n\\\"Nothing
50
+ surprises me with him. He controls the game well, passes the ball well, he
51
+ is a good finisher, he can press and recover the ball.\\n\\n\\\"He sees passes
52
+ that most people can only see whilst watching the game on TV or in the stands,
53
+ not ones that you can normally see on the field.\\\"\",\n \"language\": \"en\",\n
54
+ \ \"hashtags\": [\"#LionelMessi\", \"#Barcelona\", \"#Argentina\", \"#GerardoMartino\",
55
+ \"#BallonDOr\", \"#RAC1\", \"#RadioBroadcasting\"]\n}"
56
+ http_version:
57
+ recorded_at: Tue, 02 Dec 2014 18:15:36 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/hashtags
6
+ body:
7
+ encoding: US-ASCII
8
+ string: text=The+Google+Cast+SDK+is+simple+to+integrate+because+there%E2%80%99s+no%0A++++++need+to+write+a+new+app.+Just+incorporate+the+SDK+into+your+existing%0A++++++mobile+and+web+apps+to+bring+your+content+to+the+TV.+You+are+in%0A++++++control+of+how+and+when+you+develop+and+publish+your+cast-ready%0A++++++apps+through+the+Google+Cast+developer+console.%0A++++++The+SDK+is+available+on+Android+and+iOS+as+well+as+on+Chrome%0A++++++through+the+Google+Cast+browser+extension.
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:43 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '615'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! "{\n \"text\": \"The Google Cast SDK is simple to integrate because
38
+ there\\u2019s no\\n need to write a new app. Just incorporate the SDK
39
+ into your existing\\n mobile and web apps to bring your content to the
40
+ TV. You are in\\n control of how and when you develop and publish your
41
+ cast-ready\\n apps through the Google Cast developer console.\\n The
42
+ SDK is available on Android and iOS as well as on Chrome\\n through the
43
+ Google Cast browser extension.\",\n \"language\": \"en\",\n \"hashtags\":
44
+ [\"#SoftwareDevelopmentKit\", \"#SDK\", \"#Google\", \"#BrowserExtension\",
45
+ \"#Android\", \"#IOS\", \"#WebApplication\"]\n}"
46
+ http_version:
47
+ recorded_at: Tue, 02 Dec 2014 18:15:40 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/hashtags
6
+ body:
7
+ encoding: US-ASCII
8
+ string: url=http%3A%2F%2Fwww.bbc.com%2Fsport%2F0%2Ffootball%2F25912393
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:41 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '1421'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! "{\n \"text\": \"Lionel Messi: Forward is not for sale, says Barcelona
38
+ president\\nLionel Messi: Forward is not for sale, says Barcelona president\\n\\nBarcelona
39
+ forward Lionel Messi is not for sale and the club plan to discuss a new contract
40
+ with the Argentine, says president Josep Maria Bartomeu.\\n\\nFour-time Ballon
41
+ d'Or winner Messi, 26, is reported to be a\\n\\nIn an interview with radio
42
+ station RAC1, Bartomeu said: \\\"The club will sit down and negotiate a new
43
+ contract.\\n\\n\\\"We will do what we have to, to ensure he's the best-paid
44
+ player.\\\"\\n\\nMessi scored 60 goals in 50 appearances last season but has
45
+ struggled to match that goalscoring form in 2013-14.\\n\\nHe has scored 18
46
+ goals so far but just eight of those have been in the league.\\n\\nHis last
47
+ league goal came in September, before he was out for five weeks with a hamstring
48
+ injury.\\n\\n\\\"He can do everything,\\\" said Barca coach Gerardo Martino.
49
+ \\\"If he succeeds in other facets of his game, it doesn't matter if he scores.\\n\\n\\\"Nothing
50
+ surprises me with him. He controls the game well, passes the ball well, he
51
+ is a good finisher, he can press and recover the ball.\\n\\n\\\"He sees passes
52
+ that most people can only see whilst watching the game on TV or in the stands,
53
+ not ones that you can normally see on the field.\\\"\",\n \"language\": \"en\",\n
54
+ \ \"hashtags\": [\"#LionelMessi\", \"#Barcelona\", \"#Argentina\", \"#GerardoMartino\",
55
+ \"#BallonDOr\", \"#RAC1\", \"#RadioBroadcasting\"]\n}"
56
+ http_version:
57
+ recorded_at: Tue, 02 Dec 2014 18:15:38 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,36 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/language
6
+ body:
7
+ encoding: US-ASCII
8
+ string: text=Hello+there%21+How%27s+it+going%3F
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ response:
17
+ status:
18
+ code: 403
19
+ message: Forbidden
20
+ headers:
21
+ Server:
22
+ - openresty/1.5.12.1
23
+ Date:
24
+ - Tue, 02 Dec 2014 18:16:07 GMT
25
+ Content-Type:
26
+ - text/plain; charset=us-ascii
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ body:
32
+ encoding: US-ASCII
33
+ string: Authentication parameters missing
34
+ http_version:
35
+ recorded_at: Tue, 02 Dec 2014 18:15:04 GMT
36
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/language
6
+ body:
7
+ encoding: US-ASCII
8
+ string: wrong_param=Hello+there%21+How%27s+it+going%3F
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 400
23
+ message: Bad Request
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:07 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '70'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! '{"error" : "requirement failed: you must either provide url or text."}'
38
+ http_version:
39
+ recorded_at: Tue, 02 Dec 2014 18:15:04 GMT
40
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/language
6
+ body:
7
+ encoding: US-ASCII
8
+ string: text=Hello+there%21+How%27s+it+going%3F
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - random_string
18
+ App-Key:
19
+ - random_string
20
+ response:
21
+ status:
22
+ code: 403
23
+ message: Forbidden
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:08 GMT
29
+ Content-Type:
30
+ - text/plain; charset=us-ascii
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: Authentication failed
38
+ http_version:
39
+ recorded_at: Tue, 02 Dec 2014 18:15:05 GMT
40
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.aylien.com/api/v1/language
6
+ body:
7
+ encoding: US-ASCII
8
+ string: text=Hello+there%21+How%27s+it+going%3F
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Aylien Text API Ruby Gem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ App-Id:
17
+ - <PASSWORD>
18
+ App-Key:
19
+ - <PASSWORD>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty/1.5.12.1
27
+ Date:
28
+ - Tue, 02 Dec 2014 18:16:10 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '96'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! "{\n \"text\": \"Hello there! How's it going?\",\n \"lang\": \"en\",\n
38
+ \ \"confidence\": 0.9999968908915913\n}"
39
+ http_version:
40
+ recorded_at: Tue, 02 Dec 2014 18:15:07 GMT
41
+ recorded_with: VCR 2.9.3