transcribeme 0.0.5.beta → 1.0.0.alpha
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +2 -1
- data/.rubocop.yml +22 -0
- data/.travis.yml +8 -0
- data/Gemfile +7 -2
- data/Guardfile +35 -0
- data/README.md +36 -7
- data/Rakefile +4 -4
- data/lib/transcribeme.rb +4 -36
- data/lib/transcribeme/api/client.rb +184 -34
- data/lib/transcribeme/version.rb +2 -1
- data/spec/lib/api/client_spec.rb +133 -5
- data/spec/spec_helper.rb +1 -1
- data/spec/support/audio/yes-we-can-speech.mp3 +0 -0
- data/spec/support/cassettes/list_of_recordings.yml +212 -0
- data/spec/support/cassettes/new_session.yml +19 -26
- data/spec/support/cassettes/successful_sign_in.yml +245 -0
- data/spec/support/cassettes/successful_sign_in_after_initialize_call.yml +244 -0
- data/spec/support/cassettes/unsuccessful_sign_in.yml +167 -0
- data/spec/support/cassettes/upload_url.yml +208 -0
- data/transcribeme.gemspec +15 -13
- metadata +52 -27
- metadata.gz.sig +0 -0
- data/lib/transcribeme/api/check_transcription_ready.rb +0 -29
- data/lib/transcribeme/api/customer_login.rb +0 -33
- data/lib/transcribeme/api/finalize_session.rb +0 -30
- data/lib/transcribeme/api/recordings.rb +0 -32
- data/lib/transcribeme/api/session.rb +0 -37
- data/lib/transcribeme/api/submission.rb +0 -31
- data/lib/transcribeme/api/submission_with_promocode.rb +0 -32
- data/lib/transcribeme/api/upload_url.rb +0 -30
- data/lib/transcribeme/customer.rb +0 -5
- data/lib/transcribeme/recording.rb +0 -5
- data/lib/transcribeme/transcription.rb +0 -5
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
class CheckTranscriptionReady
|
4
|
-
def initialize(session_id, recording_id, client)
|
5
|
-
@session_id, @recording_id, @client = session_id, recording_id, client
|
6
|
-
end
|
7
|
-
|
8
|
-
def check!
|
9
|
-
response = @client.call :check_transcription_ready, xml: xml
|
10
|
-
response.body[:check_transcription_ready_response][:check_transcription_ready_result]
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def xml
|
16
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
17
|
-
xml.tag!("soapenv:Body") do |xml|
|
18
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:CheckTranscriptionReady") do |xml|
|
19
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
20
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:recId") { |xml| xml.text! @recording_id }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class CustomerLogin
|
5
|
-
|
6
|
-
attr_reader :customer_id
|
7
|
-
|
8
|
-
def initialize(session_id, username, password, client)
|
9
|
-
@session_id, @username, @password, @client = session_id, username, password, client
|
10
|
-
end
|
11
|
-
|
12
|
-
def login_on_server!
|
13
|
-
response = @client.call :sign_in, xml: xml
|
14
|
-
@customer_id = response.body[:sign_in_response][:sign_in_result]
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def xml
|
20
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
21
|
-
xml.tag!("soapenv:Body") do |xml|
|
22
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:SignIn") do |xml|
|
23
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
24
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:username") { |xml| xml.text! @username }
|
25
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:password") { |xml| xml.text! @password }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class FinalizeSession
|
5
|
-
|
6
|
-
def initialize(session_id, client)
|
7
|
-
@session_id, @client = session_id, client
|
8
|
-
end
|
9
|
-
|
10
|
-
def submit!
|
11
|
-
response = @client.call :finalize_session, xml: xml
|
12
|
-
response.body[:finalize_session_response][:finalize_session_result]
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def xml
|
18
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
19
|
-
xml.tag!("soapenv:Body") do |xml|
|
20
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:FinalizeSession") do |xml|
|
21
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class Recordings
|
5
|
-
|
6
|
-
attr_reader :list
|
7
|
-
|
8
|
-
def initialize(session_id, client)
|
9
|
-
@session_id, @client = session_id, client
|
10
|
-
end
|
11
|
-
|
12
|
-
def get_list!
|
13
|
-
response = @client.call :get_customer_recordings, xml: xml
|
14
|
-
@list = response.body[:get_customer_recordings_response][:get_customer_recordings_result][:recording_info]
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def xml
|
20
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
21
|
-
xml.tag!("soapenv:Body") do |xml|
|
22
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:GetCustomerRecordings") do |xml|
|
23
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class Session
|
5
|
-
|
6
|
-
attr_reader :session_id
|
7
|
-
|
8
|
-
def initialize(client)
|
9
|
-
@client = client
|
10
|
-
end
|
11
|
-
|
12
|
-
def create_on_server!
|
13
|
-
response = @client.call :initialize_session, xml: xml
|
14
|
-
# Without ActiveSupport
|
15
|
-
# 1.hour.from_now is 3600 seconds from Time.now
|
16
|
-
@session_expiry_time = Time.now + 3600
|
17
|
-
@session_id = response.body[:initialize_session_response][:initialize_session_result]
|
18
|
-
end
|
19
|
-
|
20
|
-
def valid?
|
21
|
-
Time.now < @session_expiry_time
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def xml
|
27
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
28
|
-
xml.tag!("soapenv:Body") do |xml|
|
29
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:InitializeSession")
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class Submission
|
5
|
-
|
6
|
-
def initialize(session_id, recording_id, client)
|
7
|
-
@session_id, @recording_id, @client = session_id, recording_id, client
|
8
|
-
end
|
9
|
-
|
10
|
-
def submit!
|
11
|
-
response = @client.call :transcribe_recording, xml: xml
|
12
|
-
response.body[:transcribe_recording_response][:transcribe_recording_result]
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def xml
|
18
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
19
|
-
xml.tag!("soapenv:Body") do |xml|
|
20
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:TranscribeRecording") do |xml|
|
21
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
22
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:recordingID") { |xml| xml.text! @recording_id }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class SubmissionWithPromocode
|
5
|
-
|
6
|
-
def initialize(session_id, recording_id, promocode, client)
|
7
|
-
@session_id, @recording_id, @promocode, @client = session_id, recording_id, promocode, client
|
8
|
-
end
|
9
|
-
|
10
|
-
def submit!
|
11
|
-
response = @client.call :transcribe_recording, xml: xml
|
12
|
-
response.body[:transcribe_recording_response][:transcribe_recording_result]
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def xml
|
18
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
19
|
-
xml.tag!("soapenv:Body") do |xml|
|
20
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:TranscribeRecording") do |xml|
|
21
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
22
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:recordingID") { |xml| xml.text! @recording_id }
|
23
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:promocode") { |xml| xml.text! @promocode }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module TranscribeMe
|
2
|
-
module API
|
3
|
-
|
4
|
-
class UploadUrl
|
5
|
-
|
6
|
-
def initialize(session_id, client)
|
7
|
-
@session_id, @client = session_id, client
|
8
|
-
end
|
9
|
-
|
10
|
-
def retrieve!
|
11
|
-
response = @client.call :get_upload_url, xml: xml
|
12
|
-
@list = response.body[:get_upload_url_response][:get_upload_url_result]
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def xml
|
18
|
-
xml = Builder::XmlMarkup.new.tag!(*SOAP_ENVELOPE) do |xml|
|
19
|
-
xml.tag!("soapenv:Body") do |xml|
|
20
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:GetUploadUrl") do |xml|
|
21
|
-
xml.tag!("#{NAMESPACE_IDENTIFIER}:sessionID") { |xml| xml.text! @session_id }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|