speechpad 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -0
- data/lib/speechpad/client.rb +1 -1
- data/lib/speechpad/version.rb +1 -1
- data/spec/helper.rb +1 -1
- data/spec/speechpad_spec.rb +8 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDgzMzUwOGE1YWUyMjAyM2ZkNzJkZmMxZTIwYmE2N2ZmYzE3ZWYwMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzY4MWU1NTg3ZTY2MTk2NDQ2Mjc3ZTY3YWQ1YjU0YWRlMzA3MmIyYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODI4M2Y2Y2JjYjliNTcyOTM1MDE3NDMzZjMzOGFhMjczNmViOWEyNjE1MTQw
|
10
|
+
MGEyYjhkNGU5MjFiOWVjMjA2OGZhNDVjY2FjNGI0ZTcwZGE4Yjg0ODY5ZmYz
|
11
|
+
ODM0MDcxZGFkYzk4ZDYwNjRhNTY0NzQxODE4Nzc3Y2UwODBjYjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWJmMzk4N2ZjNGJkNGJiYjM2NmE0Mzk2MGFjM2Q2NzZmMjhkOGY2ZmMwNjFl
|
14
|
+
YmNjNzE2NjlmMjhiMmIzYjY3ZjZlODdjYzUxODY5MWJkZDEyNjJhMDhmNzA0
|
15
|
+
YTI5YWU1ODhhMWI5NGViN2IwNjhkZTUxNWQ3ZGNlZDdjZjJlYTc=
|
data/README.md
CHANGED
data/lib/speechpad/client.rb
CHANGED
@@ -6,7 +6,7 @@ module Speechpad
|
|
6
6
|
def initialize(options={})
|
7
7
|
@access_key = options[:access_key]
|
8
8
|
@secret_key = options[:secret_key]
|
9
|
-
@speechpad_url = options[:url] || '
|
9
|
+
@speechpad_url = options[:url] || 'https://www.speechpad.com/'
|
10
10
|
end
|
11
11
|
|
12
12
|
include Speechpad::Connection
|
data/lib/speechpad/version.rb
CHANGED
data/spec/helper.rb
CHANGED
data/spec/speechpad_spec.rb
CHANGED
@@ -20,9 +20,8 @@ describe Speechpad do
|
|
20
20
|
|
21
21
|
describe ".test" do
|
22
22
|
it "should make a test call to the Speechpad API" do
|
23
|
-
|
24
|
-
|
25
|
-
to_return(:status => 200, :body => '{"error_string":"SUCCESS","response":{"value":"123"}}', :headers => {'Content-Type' => 'application/json'})
|
23
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&format=json&method=get&operation=test&service_name=account&service_version=1.0.0&signature=nemMj6yGWm6mqSpawlLRNN4ReaQ=×tamp=2014-01-01T00:00:00Z&value=123").
|
24
|
+
to_return(:status => 200, :body => '{"error_string":"SUCCESS","response":{"value":"123"}}', :headers => {'Content-Type' => 'application/json'})
|
26
25
|
|
27
26
|
@client.test.response.value.should eql "123"
|
28
27
|
end
|
@@ -30,7 +29,7 @@ describe Speechpad do
|
|
30
29
|
|
31
30
|
describe ".add_audio_url" do
|
32
31
|
it "should be a success when passing a url with a file to transcribe" do
|
33
|
-
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&format=json&method=post&operation=add_audio_url&service_name=account&service_version=1.0.0&signature=
|
32
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&format=json&method=post&operation=add_audio_url&service_name=account&service_version=1.0.0&signature=QoXYbX3s1oVqJVHoKlRBcBvE780=×tamp=2014-01-01T00:00:00Z&transcribe=true&url=https://www.speechpad.com/is_a.mp3&visible_filename=https://www.speechpad.com/is_a.mp3").
|
34
33
|
to_return(:status => 200, :body => '{"error_string":"SUCCESS", "response":{"audio_id": 63068}}' , :headers => {'Content-Type' => 'application/json'})
|
35
34
|
|
36
35
|
test = @client.add_audio_url('https://www.speechpad.com/is_a.mp3')
|
@@ -40,7 +39,7 @@ describe Speechpad do
|
|
40
39
|
|
41
40
|
describe ".add_media_url" do
|
42
41
|
it "should be a success when passing a url to transcribe" do
|
43
|
-
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&format=json&method=post&operation=add_media_url&service_name=account&service_version=1.0.0&signature=
|
42
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&format=json&method=post&operation=add_media_url&service_name=account&service_version=1.0.0&signature=u749AUoG%2BVmQApHrebxpv3N7ZgI=×tamp=2014-01-01T00:00:00Z&transcribe=true&url=http://www.youtube.com/watch?v=meiU6TxysCg").
|
44
43
|
to_return(:status => 200, :body => '{"error_string":"SUCCESS", "response":{"audio_id": 63068}}' , :headers => {'Content-Type' => 'application/json'})
|
45
44
|
|
46
45
|
test = @client.add_media_url('http://www.youtube.com/watch?v=meiU6TxysCg')
|
@@ -50,7 +49,7 @@ describe Speechpad do
|
|
50
49
|
|
51
50
|
describe ".get_transcription" do
|
52
51
|
it "should get the transcription of the audo file and return it" do
|
53
|
-
|
52
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&audio_id=1234&format=json&method=get&operation=get_transcription&service_name=account&service_version=1.0.0&signature=RFYtgGb2t4T5h5Bq5vqdl4KgL5I=×tamp=2014-01-01T00:00:00Z").
|
54
53
|
to_return(:status => 200, :body => '{"error_string":"SUCCESS","response":"Hello!"}' , :headers => {'Content-Type' => 'application/json'})
|
55
54
|
test = @client.get_transcription(1234)
|
56
55
|
test.response.should eql "Hello!"
|
@@ -59,7 +58,7 @@ describe Speechpad do
|
|
59
58
|
|
60
59
|
describe ".get_machine_transcription" do
|
61
60
|
it "should get the machine transcription of the audo file and return it" do
|
62
|
-
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&audio_id=1234&format=json&method=get&operation=get_machine_transcription&service_name=account&service_version=1.0.0&signature=
|
61
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&audio_id=1234&format=json&method=get&operation=get_machine_transcription&service_name=account&service_version=1.0.0&signature=6yg9RfjBygBzqNVbAmfNFHI1UwE=×tamp=2014-01-01T00:00:00Z").
|
63
62
|
to_return(:status => 200, :body => '{"error_string":"SUCCESS","response":"Hello!"}' , :headers => {'Content-Type' => 'application/json'})
|
64
63
|
|
65
64
|
test = @client.get_machine_transcription(1234)
|
@@ -69,7 +68,7 @@ describe Speechpad do
|
|
69
68
|
|
70
69
|
describe ".machine_transcription_status" do
|
71
70
|
it "should get the status of the machine trascript with the given id" do
|
72
|
-
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&audio_id=1234&format=json&method=get&operation=machine_transcription_status&service_name=account&service_version=1.0.0&signature=
|
71
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&audio_id=1234&format=json&method=get&operation=machine_transcription_status&service_name=account&service_version=1.0.0&signature=zB0g92ya8OZBmpGw24eSP5p37as=×tamp=2014-01-01T00:00:00Z").
|
73
72
|
to_return(:status => 200, :body => '{"error_string":"SUCCESS","response":{"1234":"done"}}' , :headers => {'Content-Type' => 'application/json'})
|
74
73
|
test = @client.machine_transcription_status('1234')
|
75
74
|
test.response['1234'].should eql 'done'
|
@@ -78,7 +77,7 @@ describe Speechpad do
|
|
78
77
|
|
79
78
|
describe ".transcription_status" do
|
80
79
|
it "should get the status of the transcription with the given id" do
|
81
|
-
|
80
|
+
stub_request(:get, "http://dev.speechpad.com/services?access_key=abc123&audio_id=1234&format=json&method=get&operation=transcription_status&service_name=account&service_version=1.0.0&signature=REAuCvHzSrsIFEIPA4iWTQMk0yg=×tamp=2014-01-01T00:00:00Z").
|
82
81
|
to_return(:status => 200, :body => '{"error_string":"SUCCESS","response":{"1234":"done"}}' , :headers => {'Content-Type' => 'application/json'})
|
83
82
|
test = @client.transcription_status('1234')
|
84
83
|
test.response['1234'].should eql 'done'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speechpad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Upworthy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|