njacobeus-tokboxer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/lib/TokBoxer/Api.rb +11 -4
- data/lib/TokBoxer/Exceptions.rb +4 -2
- data/lib/TokBoxer/User.rb +4 -16
- data/lib/tokboxer.rb +3 -1
- data/tokboxer.gemspec +6 -4
- metadata +2 -2
data/History.txt
CHANGED
data/lib/TokBoxer/Api.rb
CHANGED
@@ -276,10 +276,17 @@ module TokBoxer
|
|
276
276
|
puts "-------------------------"
|
277
277
|
end
|
278
278
|
url = URI.parse(request_url)
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
279
|
+
connection = Net::HTTP.new(url.host,url.port)
|
280
|
+
begin
|
281
|
+
response = connection.post(url.path,datastring)
|
282
|
+
rescue
|
283
|
+
raise CouldNotConnectToTokbox, "problem with URL"
|
284
|
+
end
|
285
|
+
if response.code.to_i / 100 == 2
|
286
|
+
xml_result = XmlSimple.xml_in(response.body)
|
287
|
+
else
|
288
|
+
raise CouldNotConnectToTokbox, "#{response.message} (#{response.code})"
|
289
|
+
end
|
283
290
|
if @debug
|
284
291
|
pp xml_result
|
285
292
|
puts "=========================^"
|
data/lib/TokBoxer/Exceptions.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
module TokBoxer
|
2
|
-
class
|
3
|
-
class
|
2
|
+
class TokBoxerException < RuntimeError; end;
|
3
|
+
class EmailAlreadyInUseException < TokBoxerException; end;
|
4
|
+
class CouldNotConnectToTokbox < TokBoxerException; end
|
5
|
+
class UnknownException < TokBoxerException; end;
|
4
6
|
end
|
data/lib/TokBoxer/User.rb
CHANGED
@@ -88,22 +88,10 @@ module TokBoxer
|
|
88
88
|
|
89
89
|
def player_embed_code(messageId, width="425", height="344")
|
90
90
|
<<-END
|
91
|
-
<object width="#{width}" height="#{height}">
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<param name="allowScriptAccess" value="true"></param>
|
96
|
-
<param name="flashvars" value="targetVmail=#{messageId}"></param>
|
97
|
-
<embed id="tbx_player" src="#{@api.api_server_url}#{API_SERVER_PLAYER_WIDGET}"
|
98
|
-
type="application/x-shockwave-flash"
|
99
|
-
allowfullscreen="true"
|
100
|
-
allowScriptAccess="always"
|
101
|
-
flashvars="targetVmail=#{messageId}"
|
102
|
-
width="#{width}"
|
103
|
-
height="#{height}"
|
104
|
-
>
|
105
|
-
</embed>
|
106
|
-
</object>
|
91
|
+
<object type="application/x-shockwave-flash" data="#{@api.api_server_url}#{API_SERVER_PLAYER_WIDGET}#{messageId}" width="#{width}" height="#{height}">
|
92
|
+
<param name="movie" value="#{@api.api_server_url}#{API_SERVER_PLAYER_WIDGET}#{messageId}" />
|
93
|
+
<param name="FlashVars" value="tokboxPartnerKey=#{@api.api_key}&tokboxJid=#{jabberId}&tokboxAccessSecret=#{secret}" />
|
94
|
+
</object>
|
107
95
|
END
|
108
96
|
end
|
109
97
|
|
data/lib/tokboxer.rb
CHANGED
@@ -9,8 +9,10 @@ require 'cgi'
|
|
9
9
|
require 'xmlsimple'
|
10
10
|
require 'pp' # just for debugging purposes
|
11
11
|
|
12
|
+
Net::HTTP.version_1_2 # to make sure version 1.2 is used
|
13
|
+
|
12
14
|
module TokBoxer
|
13
|
-
VERSION = '0.1.
|
15
|
+
VERSION = '0.1.4'
|
14
16
|
|
15
17
|
API_SERVER_LOGIN_URL = "view/oauth&"
|
16
18
|
API_SERVER_METHODS_URL = "a/v0"
|
data/tokboxer.gemspec
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = %q{tokboxer}
|
3
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.4"
|
4
6
|
|
5
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
8
|
s.authors = ["Nicolas Jacobeus"]
|
7
|
-
s.date = %q{2008-12-
|
9
|
+
s.date = %q{2008-12-29}
|
8
10
|
s.description = %q{This is a ruby implementation of the TokBox API. Tokbox is a free video calling / video mailing platform (see http://www.tokbox.com). All API methods specified in the Tokbox Developer API wiki (http://developers.tokbox.com/index.php/API) are implemented but not all objects yet. So you may have to dig into the hash returned by the call (XML converted to a Ruby hash). For the moment, this gem currently specifically serves our needs for the implementation of video conversations and video mails on iStockCV (www.istockcv.com), an online recruitment network which we are developing. Your needs may vary so feel free to contact me (nj@belighted.com).}
|
9
11
|
s.email = ["nj@belighted.com"]
|
10
12
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
|
@@ -14,14 +16,14 @@ Gem::Specification.new do |s|
|
|
14
16
|
s.rdoc_options = ["--main", "README.rdoc"]
|
15
17
|
s.require_paths = ["lib"]
|
16
18
|
s.rubyforge_project = %q{tokboxer}
|
17
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.3.1}
|
18
20
|
s.summary = %q{This is a ruby implementation of the TokBox API}
|
19
21
|
|
20
22
|
if s.respond_to? :specification_version then
|
21
23
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
22
24
|
s.specification_version = 2
|
23
25
|
|
24
|
-
if
|
26
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
25
27
|
s.add_runtime_dependency(%q<xml-simple>, [">= 1.0.11"])
|
26
28
|
s.add_development_dependency(%q<newgem>, [">= 1.0.5"])
|
27
29
|
s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: njacobeus-tokboxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Jacobeus
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-29 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|