twilio-twimlbin 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twilio-twimlbin.rb +2 -5
- data/twilio-twimlbin.gemspec +1 -2
- metadata +2 -2
data/lib/twilio-twimlbin.rb
CHANGED
@@ -13,22 +13,20 @@ class Twimlbin
|
|
13
13
|
def configure
|
14
14
|
@http = Net::HTTP.new('twimlbin.com', 80)
|
15
15
|
res = @http.get('/create')
|
16
|
-
cookie = res.response['set-cookie'].split('; ')[0]
|
17
|
-
@header = { "Cookie" => cookie }
|
18
16
|
@token = res.response['Location'].scan(/[^\/]+$/).last
|
19
17
|
@private_url = "http://twimlbin.com/#{@token}"
|
20
18
|
@external_url = get_external_url
|
21
19
|
end
|
22
20
|
|
23
21
|
def get_external_url
|
24
|
-
res = @http.get("/#{@token}"
|
22
|
+
res = @http.get("/#{@token}")
|
25
23
|
find_url_regex = Regexp.escape('http://twimlbin.com/external/')
|
26
24
|
regex = Regexp.new("(#{find_url_regex}[^<]+)")
|
27
25
|
return res.body[regex]
|
28
26
|
end
|
29
27
|
|
30
28
|
def publish(xml)
|
31
|
-
request = Net::HTTP::Post.new("/save_data"
|
29
|
+
request = Net::HTTP::Post.new("/save_data")
|
32
30
|
body = {'index' => @token, 'twiml' => xml}
|
33
31
|
request.set_form_data(body)
|
34
32
|
begin
|
@@ -37,6 +35,5 @@ class Twimlbin
|
|
37
35
|
raise Gem::Exception, "Twimlbin: Error: #{e.message}"
|
38
36
|
end
|
39
37
|
end
|
40
|
-
|
41
38
|
end
|
42
39
|
|
data/twilio-twimlbin.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "twilio-twimlbin"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.4"
|
7
7
|
s.authors = ["Kentaro Yoshida"]
|
8
8
|
s.email = ["y.ken.studio@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/y-ken/twimlbin"
|
@@ -14,6 +14,5 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
15
15
|
s.require_paths = ["lib"]
|
16
16
|
|
17
|
-
# specify any dependencies here; for example:
|
18
17
|
s.add_development_dependency "rake"
|
19
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-twimlbin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|