aylien_text_api 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/aylien_text_api/client.rb +15 -0
- data/lib/aylien_text_api/configuration.rb +2 -1
- data/lib/aylien_text_api/version.rb +1 -1
- data/spec/fixtures/aylien_text_api/client/classify_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/classify_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/classify_with_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/classify_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/classify_with_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/classify_with_value_as_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/classify_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/concepts_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/concepts_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/concepts_with_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/concepts_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/concepts_with_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/concepts_with_value_as_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/concepts_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/entities_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/entities_with_invalid_params.yml +17 -8
- data/spec/fixtures/aylien_text_api/client/entities_with_text.yml +10 -10
- data/spec/fixtures/aylien_text_api/client/entities_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/entities_with_valid_url.yml +455 -456
- data/spec/fixtures/aylien_text_api/client/entities_with_value_as_text.yml +10 -10
- data/spec/fixtures/aylien_text_api/client/entities_with_value_as_valid_url.yml +455 -455
- data/spec/fixtures/aylien_text_api/client/extract_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/extract_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/extract_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/extract_with_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/extract_with_value_as_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/extract_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/hashtags_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/hashtags_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/hashtags_with_text.yml +9 -8
- data/spec/fixtures/aylien_text_api/client/hashtags_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/hashtags_with_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/hashtags_with_value_as_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/hashtags_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/image_tags_with_invalid_client.yml +38 -0
- data/spec/fixtures/aylien_text_api/client/image_tags_with_invalid_params.yml +62 -0
- data/spec/fixtures/aylien_text_api/client/image_tags_with_unauthenticated_client.yml +42 -0
- data/spec/fixtures/aylien_text_api/client/image_tags_with_valid_url.yml +48 -0
- data/spec/fixtures/aylien_text_api/client/image_tags_with_value_as_text.yml +62 -0
- data/spec/fixtures/aylien_text_api/client/image_tags_with_value_as_valid_url.yml +48 -0
- data/spec/fixtures/aylien_text_api/client/language_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/language_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/language_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/language_with_valid_text.yml +8 -8
- data/spec/fixtures/aylien_text_api/client/language_with_valid_url.yml +7 -7
- data/spec/fixtures/aylien_text_api/client/language_with_value_as_text.yml +7 -7
- data/spec/fixtures/aylien_text_api/client/language_with_value_as_valid_url.yml +7 -7
- data/spec/fixtures/aylien_text_api/client/microformats_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/microformats_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/microformats_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/microformats_with_valid_url.yml +7 -7
- data/spec/fixtures/aylien_text_api/client/microformats_with_value_as_valid_url.yml +7 -7
- data/spec/fixtures/aylien_text_api/client/related_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/related_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/related_with_phrase.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/related_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/related_with_value_as_phrase.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/related_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/sentiment_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/sentiment_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/sentiment_with_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/sentiment_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/sentiment_with_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/sentiment_with_value_as_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/sentiment_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/summarize_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/summarize_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/summarize_with_title_and_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/summarize_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/summarize_with_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_title.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_without_title.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_valid_url.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_invalid_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_invalid_params.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_text.yml +7 -7
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_unauthenticated_client.yml +4 -4
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_valid_url.yml +10 -9
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_value_as_text.yml +6 -6
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_value_as_valid_url.yml +10 -9
- data/spec/lib/aylien_text_api/client_spec.rb +1 -0
- data/spec/lib/aylien_text_api/image_tags.rb +79 -0
- metadata +17 -3
data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_without_title.yml
CHANGED
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,9 +25,9 @@ http_interactions:
|
|
25
25
|
message: Bad Request
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:55 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
@@ -37,13 +37,13 @@ http_interactions:
|
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205518'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: UTF-8
|
45
45
|
string: '{"error" : "requirement failed: if you are not providing an url, both
|
46
46
|
text and title are required."}'
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Mon, 16 Mar 2015 14:33:55 GMT
|
49
49
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,9 +25,9 @@ http_interactions:
|
|
25
25
|
message: OK
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:57 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205517'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: ASCII-8BIT
|
45
45
|
string: !binary |-
|
@@ -88,5 +88,5 @@ http_interactions:
|
|
88
88
|
bGwgd2VsbCwgaGUgaXMgYSBnb29kIGZpbmlzaGVyLCBoZSBjYW4gcHJlc3Mg
|
89
89
|
YW5kIHJlY292ZXIgdGhlIGJhbGwuIl0KfQ==
|
90
90
|
http_version:
|
91
|
-
recorded_at:
|
91
|
+
recorded_at: Mon, 16 Mar 2015 14:33:57 GMT
|
92
92
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
response:
|
@@ -21,9 +21,9 @@ http_interactions:
|
|
21
21
|
message: Forbidden
|
22
22
|
headers:
|
23
23
|
Server:
|
24
|
-
- openresty/1.
|
24
|
+
- openresty/1.7.7.2
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Mon, 16 Mar 2015 14:33:05 GMT
|
27
27
|
Content-Type:
|
28
28
|
- text/plain; charset=us-ascii
|
29
29
|
Transfer-Encoding:
|
@@ -34,5 +34,5 @@ http_interactions:
|
|
34
34
|
encoding: UTF-8
|
35
35
|
string: Authentication parameters missing
|
36
36
|
http_version:
|
37
|
-
recorded_at:
|
37
|
+
recorded_at: Mon, 16 Mar 2015 14:33:05 GMT
|
38
38
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,9 +25,9 @@ http_interactions:
|
|
25
25
|
message: Bad Request
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:08 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205597'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: UTF-8
|
45
45
|
string: |-
|
@@ -53,5 +53,5 @@ http_interactions:
|
|
53
53
|
}]
|
54
54
|
}
|
55
55
|
http_version:
|
56
|
-
recorded_at:
|
56
|
+
recorded_at: Mon, 16 Mar 2015 14:33:08 GMT
|
57
57
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,9 +25,9 @@ http_interactions:
|
|
25
25
|
message: OK
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:07 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205599'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: UTF-8
|
45
45
|
string: '{"text":"CCTV footage shows the moment a suicide car bomber detonates\n a
|
@@ -47,7 +47,7 @@ http_interactions:
|
|
47
47
|
support for Hezbollah and left four people dead with many more wounded.\n A
|
48
48
|
group calling itself the al-Nusra Front in Lebanon has claimed\n responsibility
|
49
49
|
for the attack saying it was in retaliation for\n Hezbollah''s military
|
50
|
-
support of president Bashar al-Assad''s forces in Syria","classes":[{"label":"president","score":0.
|
50
|
+
support of president Bashar al-Assad''s forces in Syria","classes":[{"label":"president","score":0.024},{"label":"travel","score":0.0},{"label":"voyage","score":0.0}]}'
|
51
51
|
http_version:
|
52
|
-
recorded_at:
|
52
|
+
recorded_at: Mon, 16 Mar 2015 14:33:07 GMT
|
53
53
|
recorded_with: VCR 2.9.3
|
data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_unauthenticated_client.yml
CHANGED
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,9 +25,9 @@ http_interactions:
|
|
25
25
|
message: Forbidden
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:05 GMT
|
31
31
|
Content-Type:
|
32
32
|
- text/plain; charset=us-ascii
|
33
33
|
Transfer-Encoding:
|
@@ -38,5 +38,5 @@ http_interactions:
|
|
38
38
|
encoding: UTF-8
|
39
39
|
string: Authentication failed
|
40
40
|
http_version:
|
41
|
-
recorded_at:
|
41
|
+
recorded_at: Mon, 16 Mar 2015 14:33:05 GMT
|
42
42
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,21 +25,21 @@ http_interactions:
|
|
25
25
|
message: OK
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:05 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
34
|
-
- '
|
34
|
+
- '2198'
|
35
35
|
Connection:
|
36
36
|
- keep-alive
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205601'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: ASCII-8BIT
|
45
45
|
string: !binary |-
|
@@ -89,8 +89,9 @@ http_interactions:
|
|
89
89
|
blNvIGhvdyBkb2VzIGl0IHdvcms/IEluIHNob3J0LCBJIGxvdmUgZS1pbmsg
|
90
90
|
ZGV2aWNlcywgYW5kIHRoZSBWb3lhZ2UgaXMgdGhlIGJlc3Qgb2YgdGhlbS4g
|
91
91
|
QmVjYXVzZSBpdCBsYSIsImNsYXNzZXMiOlt7ImxhYmVsIjoidm95YWdlIiwi
|
92
|
-
|
93
|
-
|
92
|
+
c2NvcmUiOjAuMDE4NjE0MjcwOTQxMDU0ODF9LHsibGFiZWwiOiJ0cmF2ZWwi
|
93
|
+
LCJzY29yZSI6MC4wMDQxMzY1MDQ2NTM1Njc3MzZ9LHsibGFiZWwiOiJwcmVz
|
94
|
+
aWRlbnQiLCJzY29yZSI6MC4wMDEwMzQxMjYxNjMzOTE5MzR9XX0=
|
94
95
|
http_version:
|
95
|
-
recorded_at:
|
96
|
+
recorded_at: Mon, 16 Mar 2015 14:33:05 GMT
|
96
97
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,9 +25,9 @@ http_interactions:
|
|
25
25
|
message: OK
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:08 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205598'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: UTF-8
|
45
45
|
string: |-
|
@@ -53,5 +53,5 @@ http_interactions:
|
|
53
53
|
}]
|
54
54
|
}
|
55
55
|
http_version:
|
56
|
-
recorded_at:
|
56
|
+
recorded_at: Mon, 16 Mar 2015 14:33:08 GMT
|
57
57
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
User-Agent:
|
15
|
-
- Aylien Text API Ruby Gem 0.
|
15
|
+
- Aylien Text API Ruby Gem 0.2.0
|
16
16
|
Content-Type:
|
17
17
|
- application/x-www-form-urlencoded
|
18
18
|
App-Id:
|
@@ -25,21 +25,21 @@ http_interactions:
|
|
25
25
|
message: OK
|
26
26
|
headers:
|
27
27
|
Server:
|
28
|
-
- openresty/1.
|
28
|
+
- openresty/1.7.7.2
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 16 Mar 2015 14:33:01 GMT
|
31
31
|
Content-Type:
|
32
32
|
- application/json;charset=UTF-8
|
33
33
|
Content-Length:
|
34
|
-
- '
|
34
|
+
- '2198'
|
35
35
|
Connection:
|
36
36
|
- keep-alive
|
37
37
|
X-Ratelimit-Limit:
|
38
38
|
- '207000'
|
39
39
|
X-Ratelimit-Remaining:
|
40
|
-
- '
|
40
|
+
- '205602'
|
41
41
|
X-Ratelimit-Reset:
|
42
|
-
- '
|
42
|
+
- '1426550400'
|
43
43
|
body:
|
44
44
|
encoding: ASCII-8BIT
|
45
45
|
string: !binary |-
|
@@ -89,8 +89,9 @@ http_interactions:
|
|
89
89
|
blNvIGhvdyBkb2VzIGl0IHdvcms/IEluIHNob3J0LCBJIGxvdmUgZS1pbmsg
|
90
90
|
ZGV2aWNlcywgYW5kIHRoZSBWb3lhZ2UgaXMgdGhlIGJlc3Qgb2YgdGhlbS4g
|
91
91
|
QmVjYXVzZSBpdCBsYSIsImNsYXNzZXMiOlt7ImxhYmVsIjoidm95YWdlIiwi
|
92
|
-
|
93
|
-
|
92
|
+
c2NvcmUiOjAuMDE4NjE0MjcwOTQxMDU0ODF9LHsibGFiZWwiOiJ0cmF2ZWwi
|
93
|
+
LCJzY29yZSI6MC4wMDQxMzY1MDQ2NTM1Njc3MzZ9LHsibGFiZWwiOiJwcmVz
|
94
|
+
aWRlbnQiLCJzY29yZSI6MC4wMDEwMzQxMjYxNjMzOTE5MzR9XX0=
|
94
95
|
http_version:
|
95
|
-
recorded_at:
|
96
|
+
recorded_at: Mon, 16 Mar 2015 14:33:01 GMT
|
96
97
|
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,79 @@
|
|
1
|
+
describe "image_tags endpoint" do
|
2
|
+
before do
|
3
|
+
@url = "http://aylien.com/images/michaelo.png"
|
4
|
+
end
|
5
|
+
|
6
|
+
it "shouldn't be nil with valid url" do
|
7
|
+
VCR.use_cassette('image_tags_with_valid_url') do
|
8
|
+
result = @client.image_tags(url: @url)
|
9
|
+
result.wont_be_nil
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "shouldn't be nil with value as valid url" do
|
14
|
+
VCR.use_cassette('image_tags_with_value_as_valid_url') do
|
15
|
+
result = @client.image_tags(@url)
|
16
|
+
result.wont_be_nil
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should be nil with invalid params" do
|
21
|
+
VCR.use_cassette('image_tags_with_invalid_params') do
|
22
|
+
result = @client.image_tags(text: @text)
|
23
|
+
result.must_be_nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should be nil with value as text" do
|
28
|
+
VCR.use_cassette('image_tags_with_value_as_text') do
|
29
|
+
result = @client.image_tags(@text)
|
30
|
+
result.must_be_nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should be nil with unauthenticated client" do
|
35
|
+
VCR.use_cassette('image_tags_with_unauthenticated_client') do
|
36
|
+
result = @unauthenticated_client.image_tags(url: @url)
|
37
|
+
result.must_be_nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should raise Forbidden with unauthenticated client" do
|
42
|
+
VCR.use_cassette('image_tags_with_unauthenticated_client') do
|
43
|
+
proc {
|
44
|
+
@unauthenticated_client.image_tags!(url: @url)
|
45
|
+
}.must_raise AylienTextApi::Error::Forbidden
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should be nil with invalid client" do
|
50
|
+
VCR.use_cassette('image_tags_with_invalid_client') do
|
51
|
+
result = @invalid_client.image_tags(url: @url)
|
52
|
+
result.must_be_nil
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should raise Forbidden with invalid client" do
|
57
|
+
VCR.use_cassette('image_tags_with_invalid_client') do
|
58
|
+
proc {
|
59
|
+
@invalid_client.image_tags!(url: @url)
|
60
|
+
}.must_raise AylienTextApi::Error::Forbidden
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should raise BadRequest with value as text" do
|
65
|
+
VCR.use_cassette('image_tags_with_value_as_text') do
|
66
|
+
proc {
|
67
|
+
@client.image_tags!(@text)
|
68
|
+
}.must_raise AylienTextApi::Error::BadRequest
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should raise BadRequest with invalid params" do
|
73
|
+
VCR.use_cassette('image_tags_with_invalid_params') do
|
74
|
+
proc {
|
75
|
+
@client.image_tags!(wrong_param: @text)
|
76
|
+
}.must_raise AylienTextApi::Error::BadRequest
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aylien_text_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aylien Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -125,6 +125,12 @@ files:
|
|
125
125
|
- spec/fixtures/aylien_text_api/client/hashtags_with_valid_url.yml
|
126
126
|
- spec/fixtures/aylien_text_api/client/hashtags_with_value_as_text.yml
|
127
127
|
- spec/fixtures/aylien_text_api/client/hashtags_with_value_as_valid_url.yml
|
128
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_invalid_client.yml
|
129
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_invalid_params.yml
|
130
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_unauthenticated_client.yml
|
131
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_valid_url.yml
|
132
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_value_as_text.yml
|
133
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_value_as_valid_url.yml
|
128
134
|
- spec/fixtures/aylien_text_api/client/language_with_invalid_client.yml
|
129
135
|
- spec/fixtures/aylien_text_api/client/language_with_invalid_params.yml
|
130
136
|
- spec/fixtures/aylien_text_api/client/language_with_unauthenticated_client.yml
|
@@ -171,6 +177,7 @@ files:
|
|
171
177
|
- spec/lib/aylien_text_api/entities.rb
|
172
178
|
- spec/lib/aylien_text_api/extract.rb
|
173
179
|
- spec/lib/aylien_text_api/hashtags.rb
|
180
|
+
- spec/lib/aylien_text_api/image_tags.rb
|
174
181
|
- spec/lib/aylien_text_api/language.rb
|
175
182
|
- spec/lib/aylien_text_api/microformats.rb
|
176
183
|
- spec/lib/aylien_text_api/related.rb
|
@@ -198,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
205
|
version: '0'
|
199
206
|
requirements: []
|
200
207
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.4.
|
208
|
+
rubygems_version: 2.4.6
|
202
209
|
signing_key:
|
203
210
|
specification_version: 4
|
204
211
|
summary: Aylien Text API is a package of nine different Natural Language Processing,
|
@@ -239,6 +246,12 @@ test_files:
|
|
239
246
|
- spec/fixtures/aylien_text_api/client/hashtags_with_valid_url.yml
|
240
247
|
- spec/fixtures/aylien_text_api/client/hashtags_with_value_as_text.yml
|
241
248
|
- spec/fixtures/aylien_text_api/client/hashtags_with_value_as_valid_url.yml
|
249
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_invalid_client.yml
|
250
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_invalid_params.yml
|
251
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_unauthenticated_client.yml
|
252
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_valid_url.yml
|
253
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_value_as_text.yml
|
254
|
+
- spec/fixtures/aylien_text_api/client/image_tags_with_value_as_valid_url.yml
|
242
255
|
- spec/fixtures/aylien_text_api/client/language_with_invalid_client.yml
|
243
256
|
- spec/fixtures/aylien_text_api/client/language_with_invalid_params.yml
|
244
257
|
- spec/fixtures/aylien_text_api/client/language_with_unauthenticated_client.yml
|
@@ -285,6 +298,7 @@ test_files:
|
|
285
298
|
- spec/lib/aylien_text_api/entities.rb
|
286
299
|
- spec/lib/aylien_text_api/extract.rb
|
287
300
|
- spec/lib/aylien_text_api/hashtags.rb
|
301
|
+
- spec/lib/aylien_text_api/image_tags.rb
|
288
302
|
- spec/lib/aylien_text_api/language.rb
|
289
303
|
- spec/lib/aylien_text_api/microformats.rb
|
290
304
|
- spec/lib/aylien_text_api/related.rb
|