aylien_text_api 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/LICENSE +1 -1
- data/lib/aylien_text_api.rb +1 -1
- data/lib/aylien_text_api/client.rb +57 -13
- data/lib/aylien_text_api/configuration.rb +14 -3
- data/lib/aylien_text_api/connection.rb +4 -2
- data/lib/aylien_text_api/error.rb +1 -1
- data/lib/aylien_text_api/version.rb +2 -2
- data/spec/fixtures/aylien_text_api/client/classify_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/classify_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/classify_with_text.yml +25 -16
- data/spec/fixtures/aylien_text_api/client/classify_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/classify_with_valid_url.yml +115 -67
- data/spec/fixtures/aylien_text_api/client/classify_with_value_as_text.yml +25 -16
- data/spec/fixtures/aylien_text_api/client/classify_with_value_as_valid_url.yml +115 -67
- data/spec/fixtures/aylien_text_api/client/concepts_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/concepts_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/concepts_with_text.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/concepts_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/concepts_with_valid_url.yml +109 -32
- data/spec/fixtures/aylien_text_api/client/concepts_with_value_as_text.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/concepts_with_value_as_valid_url.yml +109 -32
- data/spec/fixtures/aylien_text_api/client/entities_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/entities_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/entities_with_text.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/entities_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/entities_with_valid_url.yml +466 -271
- data/spec/fixtures/aylien_text_api/client/entities_with_value_as_text.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/entities_with_value_as_valid_url.yml +465 -271
- data/spec/fixtures/aylien_text_api/client/extract_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/extract_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/extract_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/extract_with_valid_url.yml +267 -154
- data/spec/fixtures/aylien_text_api/client/extract_with_value_as_text.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/extract_with_value_as_valid_url.yml +267 -154
- data/spec/fixtures/aylien_text_api/client/hashtags_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/hashtags_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/hashtags_with_text.yml +31 -17
- data/spec/fixtures/aylien_text_api/client/hashtags_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/hashtags_with_valid_url.yml +51 -27
- data/spec/fixtures/aylien_text_api/client/hashtags_with_value_as_text.yml +32 -17
- data/spec/fixtures/aylien_text_api/client/hashtags_with_value_as_valid_url.yml +51 -27
- data/spec/fixtures/aylien_text_api/client/language_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/language_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/language_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/language_with_valid_text.yml +21 -9
- data/spec/fixtures/aylien_text_api/client/language_with_valid_url.yml +46 -26
- data/spec/fixtures/aylien_text_api/client/language_with_value_as_text.yml +21 -9
- data/spec/fixtures/aylien_text_api/client/language_with_value_as_valid_url.yml +46 -26
- data/spec/fixtures/aylien_text_api/client/microformats_with_invalid_client.yml +38 -0
- data/spec/fixtures/aylien_text_api/client/microformats_with_invalid_params.yml +62 -0
- data/spec/fixtures/aylien_text_api/client/microformats_with_unauthenticated_client.yml +42 -0
- data/spec/fixtures/aylien_text_api/client/microformats_with_valid_url.yml +84 -0
- data/spec/fixtures/aylien_text_api/client/microformats_with_value_as_valid_url.yml +84 -0
- data/spec/fixtures/aylien_text_api/client/related_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/related_with_invalid_params.yml +17 -9
- data/spec/fixtures/aylien_text_api/client/related_with_phrase.yml +80 -28
- data/spec/fixtures/aylien_text_api/client/related_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/related_with_value_as_phrase.yml +80 -28
- data/spec/fixtures/aylien_text_api/client/related_with_value_as_valid_url.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/sentiment_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/sentiment_with_invalid_params.yml +16 -8
- data/spec/fixtures/aylien_text_api/client/sentiment_with_text.yml +23 -21
- data/spec/fixtures/aylien_text_api/client/sentiment_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/sentiment_with_valid_url.yml +49 -26
- data/spec/fixtures/aylien_text_api/client/sentiment_with_value_as_text.yml +23 -21
- data/spec/fixtures/aylien_text_api/client/sentiment_with_value_as_valid_url.yml +49 -26
- data/spec/fixtures/aylien_text_api/client/summarize_with_invalid_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/summarize_with_invalid_params.yml +17 -9
- data/spec/fixtures/aylien_text_api/client/summarize_with_title_and_text.yml +20 -46
- data/spec/fixtures/aylien_text_api/client/summarize_with_unauthenticated_client.yml +7 -5
- data/spec/fixtures/aylien_text_api/client/summarize_with_valid_url.yml +61 -34
- data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_title.yml +20 -46
- data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_without_title.yml +17 -9
- data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_valid_url.yml +61 -34
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_invalid_client.yml +38 -0
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_invalid_params.yml +57 -0
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_text.yml +53 -0
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_unauthenticated_client.yml +42 -0
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_valid_url.yml +96 -0
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_value_as_text.yml +57 -0
- data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_value_as_valid_url.yml +96 -0
- data/spec/lib/aylien_text_api/client_spec.rb +13 -3
- data/spec/lib/aylien_text_api/microformats.rb +66 -0
- data/spec/lib/aylien_text_api/unsupervised_classify.rb +87 -0
- metadata +105 -5
@@ -7,16 +7,18 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: title=Batman+at+his+best+and+beyond&text=Batman+has+always+been+my+favourite+superhero+ever+since+the+first+time+I+heard+about+him+because+he+his+human+with+no+powers%2C+also+he+is+much+more+questionable+than+any+other+superhero.+The+story+of+the+film+is+about+Batman%2C+Lieutenant+James+Gordon%2C+and+new+district+attorney+Harvey+Dent+beginning+to+succeed+in+rounding+up+the+criminals+that+plague+Gotham+City.+They+are+unexpectedly+challenged+when+a+mysterious+criminal+mastermind+known+as+the+Joker+appears+in+Gotham.+Batman%27s+struggle+against+the+Joker+becomes+deeply+personal%2C+forcing+him+to+%22confront+everything+he+believes%22+and+to+improve+his+technology+%28which+introduces+the+recreation+of+the+Batcycle%2C+known+as+the+Batpod+and+the+Batsuit+was+redesigned%29+to+stop+the+madman%27s+campaign+of+destruction.+During+the+course+of+the+film%2C+a+love+triangle+develops+between+Bruce+Wayne%2C+Dent+and+Rachel+Dawes.++There+are+now+six+Batman+films+and+I+must+say+that+The+Dark+Knight+is+the+best+out+of+all+of+them.+The+title+is+good+because+that+is+what+Batman+actually+is.+It+has+been+3+years+for+the+adventure+to+continue+from+Batman+Begins+but+that+entire+wait+was+worth+it.+Gotham+city+is+very+Gothic+looking+and+is+very+haunting+and+visionary.+The+whole+movie+is+charged+with+pulse-pounding+suspense%2C+ingenious+special+effects+and+riveting+performances+from+a+first-rate+cast+especially+from+Heath+Ledger+who+gave+an+Oscar+nomination+performance+for+best+supporting-actor.+It+is+a+shame+that+he+can%27t+see+his+terrific+work+on-screen.+The+cinematography+is+excellent+which+is+made+so+dark+%26+sinister+that+really+did+suit+the+mood+for+the+film.+Usually+sequels+don%27t+turn+out+to+be+better+than+the+original+but+The+Dark+Knight+is+one+of+those+rare+sequels+that+surpasses+the+original+like+The+Godfather+2.+I+also+really+liked+the+poster+where+the+building+is+on+fire+in+a+Bat+symbol+%26+Batman+is+standing+in+front+of+it.+Christopher+Nolan+is+a+brilliant+director+and+his+film+Memento+is+one+of+my+most+favourite+films.+He+hasn%27t+made+10+movies+yet+and+3+of+them+are+already+on+the+IMDb+top+250.+Overall+The+Dark+Knight+is+the+kind+of+movie+that+will+make+the+audience+cheer+in+the+end+instead+of+throwing+fruit+%26+vegetables+on+the+screen.
|
9
9
|
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
10
12
|
Accept:
|
11
|
-
-
|
13
|
+
- "*/*"
|
12
14
|
User-Agent:
|
13
|
-
- Aylien Text API Ruby Gem 0.0
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
14
16
|
Content-Type:
|
15
17
|
- application/x-www-form-urlencoded
|
16
18
|
App-Id:
|
17
|
-
- <PASSWORD>
|
19
|
+
- "<PASSWORD>"
|
18
20
|
App-Key:
|
19
|
-
- <PASSWORD>
|
21
|
+
- "<PASSWORD>"
|
20
22
|
response:
|
21
23
|
status:
|
22
24
|
code: 200
|
@@ -25,54 +27,26 @@ http_interactions:
|
|
25
27
|
Server:
|
26
28
|
- openresty/1.5.12.1
|
27
29
|
Date:
|
28
|
-
- Tue,
|
30
|
+
- Tue, 10 Feb 2015 14:06:00 GMT
|
29
31
|
Content-Type:
|
30
32
|
- application/json;charset=UTF-8
|
31
33
|
Content-Length:
|
32
34
|
- '2952'
|
33
35
|
Connection:
|
34
36
|
- keep-alive
|
37
|
+
X-Ratelimit-Limit:
|
38
|
+
- '207000'
|
39
|
+
X-Ratelimit-Remaining:
|
40
|
+
- '205393'
|
41
|
+
X-Ratelimit-Reset:
|
42
|
+
- '1423612800'
|
35
43
|
body:
|
36
|
-
encoding:
|
37
|
-
string:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
City. They are unexpectedly challenged when a mysterious criminal mastermind
|
43
|
-
known as the Joker appears in Gotham. Batman's struggle against the Joker
|
44
|
-
becomes deeply personal, forcing him to \\\"confront everything he believes\\\"
|
45
|
-
and to improve his technology (which introduces the recreation of the Batcycle,
|
46
|
-
known as the Batpod and the Batsuit was redesigned) to stop the madman's campaign
|
47
|
-
of destruction. During the course of the film, a love triangle develops between
|
48
|
-
Bruce Wayne, Dent and Rachel Dawes. There are now six Batman films and I
|
49
|
-
must say that The Dark Knight is the best out of all of them. The title is
|
50
|
-
good because that is what Batman actually is. It has been 3 years for the
|
51
|
-
adventure to continue from Batman Begins but that entire wait was worth it.
|
52
|
-
Gotham city is very Gothic looking and is very haunting and visionary. The
|
53
|
-
whole movie is charged with pulse-pounding suspense, ingenious special effects
|
54
|
-
and riveting performances from a first-rate cast especially from Heath Ledger
|
55
|
-
who gave an Oscar nomination performance for best supporting-actor. It is
|
56
|
-
a shame that he can't see his terrific work on-screen. The cinematography
|
57
|
-
is excellent which is made so dark & sinister that really did suit the mood
|
58
|
-
for the film. Usually sequels don't turn out to be better than the original
|
59
|
-
but The Dark Knight is one of those rare sequels that surpasses the original
|
60
|
-
like The Godfather 2. I also really liked the poster where the building is
|
61
|
-
on fire in a Bat symbol & Batman is standing in front of it. Christopher Nolan
|
62
|
-
is a brilliant director and his film Memento is one of my most favourite films.
|
63
|
-
He hasn't made 10 movies yet and 3 of them are already on the IMDb top 250.
|
64
|
-
Overall The Dark Knight is the kind of movie that will make the audience cheer
|
65
|
-
in the end instead of throwing fruit & vegetables on the screen.\",\n \"sentences\":
|
66
|
-
[\"Batman has always been my favourite superhero ever since the first time
|
67
|
-
I heard about him because he his human with no powers, also he is much more
|
68
|
-
questionable than any other superhero.\", \"The story of the film is about
|
69
|
-
Batman, Lieutenant James Gordon, and new district attorney Harvey Dent beginning
|
70
|
-
to succeed in rounding up the criminals that plague Gotham City.\", \"There
|
71
|
-
are now six Batman films and I must say that The Dark Knight is the best out
|
72
|
-
of all of them.\", \"The cinematography is excellent which is made so dark
|
73
|
-
& sinister that really did suit the mood for the film.\", \"Overall The Dark
|
74
|
-
Knight is the kind of movie that will make the audience cheer in the end instead
|
75
|
-
of throwing fruit & vegetables on the screen.\"]\n}"
|
44
|
+
encoding: UTF-8
|
45
|
+
string: |-
|
46
|
+
{
|
47
|
+
"text": "Batman has always been my favourite superhero ever since the first time I heard about him because he his human with no powers, also he is much more questionable than any other superhero. The story of the film is about Batman, Lieutenant James Gordon, and new district attorney Harvey Dent beginning to succeed in rounding up the criminals that plague Gotham City. They are unexpectedly challenged when a mysterious criminal mastermind known as the Joker appears in Gotham. Batman's struggle against the Joker becomes deeply personal, forcing him to \"confront everything he believes\" and to improve his technology (which introduces the recreation of the Batcycle, known as the Batpod and the Batsuit was redesigned) to stop the madman's campaign of destruction. During the course of the film, a love triangle develops between Bruce Wayne, Dent and Rachel Dawes. There are now six Batman films and I must say that The Dark Knight is the best out of all of them. The title is good because that is what Batman actually is. It has been 3 years for the adventure to continue from Batman Begins but that entire wait was worth it. Gotham city is very Gothic looking and is very haunting and visionary. The whole movie is charged with pulse-pounding suspense, ingenious special effects and riveting performances from a first-rate cast especially from Heath Ledger who gave an Oscar nomination performance for best supporting-actor. It is a shame that he can't see his terrific work on-screen. The cinematography is excellent which is made so dark & sinister that really did suit the mood for the film. Usually sequels don't turn out to be better than the original but The Dark Knight is one of those rare sequels that surpasses the original like The Godfather 2. I also really liked the poster where the building is on fire in a Bat symbol & Batman is standing in front of it. Christopher Nolan is a brilliant director and his film Memento is one of my most favourite films. He hasn't made 10 movies yet and 3 of them are already on the IMDb top 250. Overall The Dark Knight is the kind of movie that will make the audience cheer in the end instead of throwing fruit & vegetables on the screen.",
|
48
|
+
"sentences": ["Batman has always been my favourite superhero ever since the first time I heard about him because he his human with no powers, also he is much more questionable than any other superhero.", "The story of the film is about Batman, Lieutenant James Gordon, and new district attorney Harvey Dent beginning to succeed in rounding up the criminals that plague Gotham City.", "There are now six Batman films and I must say that The Dark Knight is the best out of all of them.", "The cinematography is excellent which is made so dark & sinister that really did suit the mood for the film.", "Overall The Dark Knight is the kind of movie that will make the audience cheer in the end instead of throwing fruit & vegetables on the screen."]
|
49
|
+
}
|
76
50
|
http_version:
|
77
|
-
recorded_at: Tue,
|
51
|
+
recorded_at: Tue, 10 Feb 2015 14:05:45 GMT
|
78
52
|
recorded_with: VCR 2.9.3
|
data/spec/fixtures/aylien_text_api/client/summarize_with_value_as_text_and_without_title.yml
CHANGED
@@ -7,16 +7,18 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: text=Batman+has+always+been+my+favourite+superhero+ever+since+the+first+time+I+heard+about+him+because+he+his+human+with+no+powers%2C+also+he+is+much+more+questionable+than+any+other+superhero.+The+story+of+the+film+is+about+Batman%2C+Lieutenant+James+Gordon%2C+and+new+district+attorney+Harvey+Dent+beginning+to+succeed+in+rounding+up+the+criminals+that+plague+Gotham+City.+They+are+unexpectedly+challenged+when+a+mysterious+criminal+mastermind+known+as+the+Joker+appears+in+Gotham.+Batman%27s+struggle+against+the+Joker+becomes+deeply+personal%2C+forcing+him+to+%22confront+everything+he+believes%22+and+to+improve+his+technology+%28which+introduces+the+recreation+of+the+Batcycle%2C+known+as+the+Batpod+and+the+Batsuit+was+redesigned%29+to+stop+the+madman%27s+campaign+of+destruction.+During+the+course+of+the+film%2C+a+love+triangle+develops+between+Bruce+Wayne%2C+Dent+and+Rachel+Dawes.++There+are+now+six+Batman+films+and+I+must+say+that+The+Dark+Knight+is+the+best+out+of+all+of+them.+The+title+is+good+because+that+is+what+Batman+actually+is.+It+has+been+3+years+for+the+adventure+to+continue+from+Batman+Begins+but+that+entire+wait+was+worth+it.+Gotham+city+is+very+Gothic+looking+and+is+very+haunting+and+visionary.+The+whole+movie+is+charged+with+pulse-pounding+suspense%2C+ingenious+special+effects+and+riveting+performances+from+a+first-rate+cast+especially+from+Heath+Ledger+who+gave+an+Oscar+nomination+performance+for+best+supporting-actor.+It+is+a+shame+that+he+can%27t+see+his+terrific+work+on-screen.+The+cinematography+is+excellent+which+is+made+so+dark+%26+sinister+that+really+did+suit+the+mood+for+the+film.+Usually+sequels+don%27t+turn+out+to+be+better+than+the+original+but+The+Dark+Knight+is+one+of+those+rare+sequels+that+surpasses+the+original+like+The+Godfather+2.+I+also+really+liked+the+poster+where+the+building+is+on+fire+in+a+Bat+symbol+%26+Batman+is+standing+in+front+of+it.+Christopher+Nolan+is+a+brilliant+director+and+his+film+Memento+is+one+of+my+most+favourite+films.+He+hasn%27t+made+10+movies+yet+and+3+of+them+are+already+on+the+IMDb+top+250.+Overall+The+Dark+Knight+is+the+kind+of+movie+that+will+make+the+audience+cheer+in+the+end+instead+of+throwing+fruit+%26+vegetables+on+the+screen.
|
9
9
|
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
10
12
|
Accept:
|
11
|
-
-
|
13
|
+
- "*/*"
|
12
14
|
User-Agent:
|
13
|
-
- Aylien Text API Ruby Gem 0.0
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
14
16
|
Content-Type:
|
15
17
|
- application/x-www-form-urlencoded
|
16
18
|
App-Id:
|
17
|
-
- <PASSWORD>
|
19
|
+
- "<PASSWORD>"
|
18
20
|
App-Key:
|
19
|
-
- <PASSWORD>
|
21
|
+
- "<PASSWORD>"
|
20
22
|
response:
|
21
23
|
status:
|
22
24
|
code: 400
|
@@ -25,17 +27,23 @@ http_interactions:
|
|
25
27
|
Server:
|
26
28
|
- openresty/1.5.12.1
|
27
29
|
Date:
|
28
|
-
- Tue,
|
30
|
+
- Tue, 10 Feb 2015 14:06:03 GMT
|
29
31
|
Content-Type:
|
30
32
|
- application/json;charset=UTF-8
|
31
33
|
Content-Length:
|
32
34
|
- '100'
|
33
35
|
Connection:
|
34
36
|
- keep-alive
|
37
|
+
X-Ratelimit-Limit:
|
38
|
+
- '207000'
|
39
|
+
X-Ratelimit-Remaining:
|
40
|
+
- '205390'
|
41
|
+
X-Ratelimit-Reset:
|
42
|
+
- '1423612800'
|
35
43
|
body:
|
36
|
-
encoding:
|
37
|
-
string:
|
38
|
-
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"error" : "requirement failed: if you are not providing an url, both
|
46
|
+
text and title are required."}'
|
39
47
|
http_version:
|
40
|
-
recorded_at: Tue,
|
48
|
+
recorded_at: Tue, 10 Feb 2015 14:05:48 GMT
|
41
49
|
recorded_with: VCR 2.9.3
|
@@ -7,16 +7,18 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: url=http%3A%2F%2Fwww.bbc.com%2Fsport%2F0%2Ffootball%2F25912393
|
9
9
|
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
10
12
|
Accept:
|
11
|
-
-
|
13
|
+
- "*/*"
|
12
14
|
User-Agent:
|
13
|
-
- Aylien Text API Ruby Gem 0.0
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
14
16
|
Content-Type:
|
15
17
|
- application/x-www-form-urlencoded
|
16
18
|
App-Id:
|
17
|
-
- <PASSWORD>
|
19
|
+
- "<PASSWORD>"
|
18
20
|
App-Key:
|
19
|
-
- <PASSWORD>
|
21
|
+
- "<PASSWORD>"
|
20
22
|
response:
|
21
23
|
status:
|
22
24
|
code: 200
|
@@ -25,41 +27,66 @@ http_interactions:
|
|
25
27
|
Server:
|
26
28
|
- openresty/1.5.12.1
|
27
29
|
Date:
|
28
|
-
- Tue,
|
30
|
+
- Tue, 10 Feb 2015 14:06:03 GMT
|
29
31
|
Content-Type:
|
30
32
|
- application/json;charset=UTF-8
|
31
33
|
Content-Length:
|
32
|
-
- '
|
34
|
+
- '1960'
|
33
35
|
Connection:
|
34
36
|
- keep-alive
|
37
|
+
X-Ratelimit-Limit:
|
38
|
+
- '207000'
|
39
|
+
X-Ratelimit-Remaining:
|
40
|
+
- '205391'
|
41
|
+
X-Ratelimit-Reset:
|
42
|
+
- '1423612800'
|
35
43
|
body:
|
36
|
-
encoding:
|
37
|
-
string: !
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
44
|
+
encoding: ASCII-8BIT
|
45
|
+
string: !binary |-
|
46
|
+
ewogICJ0ZXh0IjogIkxpb25lbCBNZXNzaTogRm9yd2FyZCBpcyBub3QgZm9y
|
47
|
+
IHNhbGUsIHNheXMgQmFyY2Vsb25hIHByZXNpZGVudFxuXG5CYXJjZWxvbmEg
|
48
|
+
Zm9yd2FyZCBMaW9uZWwgTWVzc2kgaXMgbm90IGZvciBzYWxlIGFuZCB0aGUg
|
49
|
+
Y2x1YiBwbGFuIHRvIGRpc2N1c3MgYSBuZXcgY29udHJhY3Qgd2l0aCB0aGUg
|
50
|
+
QXJnZW50aW5lLCBzYXlzIHByZXNpZGVudCBKb3NlcCBNYXJpYSBCYXJ0b21l
|
51
|
+
dS5cblxuRm91ci10aW1lIEJhbGxvbiBkJ09yIHdpbm5lciBNZXNzaSwgMjYs
|
52
|
+
IGlzIHJlcG9ydGVkIHRvIGJlIGEgdGFyZ2V0IGZvciBGcmVuY2ggc2lkZSBQ
|
53
|
+
YXJpcyBTdC1HZXJtYWluLlxuXG5JbiB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FtZSBpbiBTZXB0ZW1iZXIsIGJl
|
84
|
+
Zm9yZSBoZSB3YXMgb3V0IGZvciBmaXZlIHdlZWtzIHdpdGggYSBoYW1zdHJp
|
85
|
+
bmcgaW5qdXJ5LiIsICJcIklmIGhlIHN1Y2NlZWRzIGluIG90aGVyIGZhY2V0
|
86
|
+
cyBvZiBoaXMgZ2FtZSwgaXQgZG9lc24ndCBtYXR0ZXIgaWYgaGUgc2NvcmVz
|
87
|
+
LiIsICJIZSBjb250cm9scyB0aGUgZ2FtZSB3ZWxsLCBwYXNzZXMgdGhlIGJh
|
88
|
+
bGwgd2VsbCwgaGUgaXMgYSBnb29kIGZpbmlzaGVyLCBoZSBjYW4gcHJlc3Mg
|
89
|
+
YW5kIHJlY292ZXIgdGhlIGJhbGwuIl0KfQ==
|
63
90
|
http_version:
|
64
|
-
recorded_at: Tue,
|
91
|
+
recorded_at: Tue, 10 Feb 2015 14:05:48 GMT
|
65
92
|
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.aylien.com/api/v1/classify/unsupervised
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: text=CCTV+footage+shows+the+moment+a+suicide+car+bomber+detonates%0A++++++a+device+in+Beirut+on+Tuesday.+The+incident+took+place+in+an+area%0A++++++of+support+for+Hezbollah+and+left+four+people+dead+with+many+more+wounded.%0A++++++A+group+calling+itself+the+al-Nusra+Front+in+Lebanon+has+claimed%0A++++++responsibility+for+the+attack+saying+it+was+in+retaliation+for%0A++++++Hezbollah%27s+military+support+of+president+Bashar+al-Assad%27s+forces+in+Syria&class=voyage&class=travel&class=president
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 403
|
21
|
+
message: Forbidden
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- openresty/1.5.12.1
|
25
|
+
Date:
|
26
|
+
- Tue, 10 Feb 2015 14:06:25 GMT
|
27
|
+
Content-Type:
|
28
|
+
- text/plain; charset=us-ascii
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: Authentication parameters missing
|
36
|
+
http_version:
|
37
|
+
recorded_at: Tue, 10 Feb 2015 14:06:10 GMT
|
38
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.aylien.com/api/v1/classify/unsupervised
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: wrong_param=CCTV+footage+shows+the+moment+a+suicide+car+bomber+detonates%0A++++++a+device+in+Beirut+on+Tuesday.+The+incident+took+place+in+an+area%0A++++++of+support+for+Hezbollah+and+left+four+people+dead+with+many+more+wounded.%0A++++++A+group+calling+itself+the+al-Nusra+Front+in+Lebanon+has+claimed%0A++++++responsibility+for+the+attack+saying+it+was+in+retaliation+for%0A++++++Hezbollah%27s+military+support+of+president+Bashar+al-Assad%27s+forces+in+Syria&class=voyage&class=travel&class=president
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
App-Id:
|
19
|
+
- "<PASSWORD>"
|
20
|
+
App-Key:
|
21
|
+
- "<PASSWORD>"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 400
|
25
|
+
message: Bad Request
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- openresty/1.5.12.1
|
29
|
+
Date:
|
30
|
+
- Tue, 10 Feb 2015 14:07:06 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json;charset=UTF-8
|
33
|
+
Content-Length:
|
34
|
+
- '221'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Ratelimit-Limit:
|
38
|
+
- '207000'
|
39
|
+
X-Ratelimit-Remaining:
|
40
|
+
- '205360'
|
41
|
+
X-Ratelimit-Reset:
|
42
|
+
- '1423612800'
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: |-
|
46
|
+
{
|
47
|
+
"error": "requirement failed: Either text or url is required.",
|
48
|
+
"errors": [{
|
49
|
+
"reason": "required",
|
50
|
+
"message": "Either text or url is required.",
|
51
|
+
"locationType": "parameter",
|
52
|
+
"location": "text"
|
53
|
+
}]
|
54
|
+
}
|
55
|
+
http_version:
|
56
|
+
recorded_at: Tue, 10 Feb 2015 14:06:51 GMT
|
57
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.aylien.com/api/v1/classify/unsupervised
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: text=CCTV+footage+shows+the+moment+a+suicide+car+bomber+detonates%0A++++++a+device+in+Beirut+on+Tuesday.+The+incident+took+place+in+an+area%0A++++++of+support+for+Hezbollah+and+left+four+people+dead+with+many+more+wounded.%0A++++++A+group+calling+itself+the+al-Nusra+Front+in+Lebanon+has+claimed%0A++++++responsibility+for+the+attack+saying+it+was+in+retaliation+for%0A++++++Hezbollah%27s+military+support+of+president+Bashar+al-Assad%27s+forces+in+Syria&class=voyage&class=travel&class=president
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
App-Id:
|
19
|
+
- "<PASSWORD>"
|
20
|
+
App-Key:
|
21
|
+
- "<PASSWORD>"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- openresty/1.5.12.1
|
29
|
+
Date:
|
30
|
+
- Tue, 10 Feb 2015 14:06:48 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json;charset=UTF-8
|
33
|
+
Content-Length:
|
34
|
+
- '561'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Ratelimit-Limit:
|
38
|
+
- '207000'
|
39
|
+
X-Ratelimit-Remaining:
|
40
|
+
- '205364'
|
41
|
+
X-Ratelimit-Reset:
|
42
|
+
- '1423612800'
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"text":"CCTV footage shows the moment a suicide car bomber detonates\n a
|
46
|
+
device in Beirut on Tuesday. The incident took place in an area\n of
|
47
|
+
support for Hezbollah and left four people dead with many more wounded.\n A
|
48
|
+
group calling itself the al-Nusra Front in Lebanon has claimed\n responsibility
|
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.032},{"label":"travel","score":0.0},{"label":"voyage","score":0.0}]}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Tue, 10 Feb 2015 14:06:33 GMT
|
53
|
+
recorded_with: VCR 2.9.3
|
data/spec/fixtures/aylien_text_api/client/unsupervised_classify_with_unauthenticated_client.yml
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.aylien.com/api/v1/classify/unsupervised
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: text=CCTV+footage+shows+the+moment+a+suicide+car+bomber+detonates%0A++++++a+device+in+Beirut+on+Tuesday.+The+incident+took+place+in+an+area%0A++++++of+support+for+Hezbollah+and+left+four+people+dead+with+many+more+wounded.%0A++++++A+group+calling+itself+the+al-Nusra+Front+in+Lebanon+has+claimed%0A++++++responsibility+for+the+attack+saying+it+was+in+retaliation+for%0A++++++Hezbollah%27s+military+support+of+president+Bashar+al-Assad%27s+forces+in+Syria&class=voyage&class=travel&class=president
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Aylien Text API Ruby Gem 0.1.0
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
App-Id:
|
19
|
+
- random_string
|
20
|
+
App-Key:
|
21
|
+
- random_string
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 403
|
25
|
+
message: Forbidden
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- openresty/1.5.12.1
|
29
|
+
Date:
|
30
|
+
- Tue, 10 Feb 2015 14:07:06 GMT
|
31
|
+
Content-Type:
|
32
|
+
- text/plain; charset=us-ascii
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: Authentication failed
|
40
|
+
http_version:
|
41
|
+
recorded_at: Tue, 10 Feb 2015 14:06:51 GMT
|
42
|
+
recorded_with: VCR 2.9.3
|