kellysutton-bliptv 0.1.0 → 0.1.1
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.
- data/README.rdoc +8 -6
- data/Rakefile +1 -1
- data/bliptv.gemspec +1 -1
- data/lib/bliptv.rb +5 -0
- data/lib/bliptv/request.rb +5 -2
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
= Blip.tv Ruby Library
|
2
2
|
|
3
|
-
A Ruby gem for accessing the
|
3
|
+
A Ruby gem for accessing the blip.tv API (http://wiki.blip.tv/index.php/REST_Upload_API)
|
4
4
|
|
5
5
|
== Install
|
6
6
|
|
7
|
-
sudo gem install bliptv --source http://gems.github.com
|
7
|
+
sudo gem install kellysutton-bliptv --source http://gems.github.com
|
8
8
|
|
9
9
|
== Usage
|
10
10
|
|
11
|
-
While the
|
12
|
-
library to make life even easier. The BlipTV Ruby
|
11
|
+
While the blip.tv API is extremely simple to use, sometimes it's nice to have a wrapper
|
12
|
+
library to make life even easier. The BlipTV Ruby gem is just that.
|
13
13
|
|
14
14
|
Let's say you want to upload a video:
|
15
15
|
|
16
|
+
require 'rubygems'
|
16
17
|
require 'bliptv'
|
17
18
|
|
18
19
|
client = BlipTV::Base.new
|
@@ -32,6 +33,7 @@ that you can play around with.
|
|
32
33
|
|
33
34
|
Or what if you wanted a list of all videos by a user? Also easy:
|
34
35
|
|
36
|
+
require 'rubygems'
|
35
37
|
require 'bliptv'
|
36
38
|
|
37
39
|
client = BlipTV::Base.new
|
@@ -48,13 +50,13 @@ Kelly Sutton (http://michaelkellysutton.com)
|
|
48
50
|
|
49
51
|
== Features
|
50
52
|
|
51
|
-
Provides an easy way to interact with the
|
53
|
+
Provides an easy way to interact with the blip.tv API in Ruby.
|
52
54
|
|
53
55
|
== Special Thanks
|
54
56
|
|
55
57
|
This gem is extensively based on Shane Vitrana's Viddler
|
56
58
|
gem as well as the YouTubeG gem. Much of the code was simply
|
57
|
-
copied and then tweaked to fit the
|
59
|
+
copied and then tweaked to fit the blip.tv nomenclature
|
58
60
|
of certain calls.
|
59
61
|
|
60
62
|
== License
|
data/Rakefile
CHANGED
data/bliptv.gemspec
CHANGED
data/lib/bliptv.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
#
|
2
|
+
# This is the main entry point for the library. All files in the project are
|
3
|
+
# included here, as well as anything required across the project.
|
4
|
+
#
|
5
|
+
|
1
6
|
$:.unshift(File.dirname(__FILE__)) unless
|
2
7
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
8
|
|
data/lib/bliptv/request.rb
CHANGED
@@ -74,8 +74,11 @@ module BlipTV
|
|
74
74
|
def parse_response(raw_response)
|
75
75
|
raise EmptyResponseError if raw_response.blank?
|
76
76
|
response_hash = Hash.from_xml(raw_response)
|
77
|
-
|
78
|
-
|
77
|
+
begin
|
78
|
+
if response_error = response_hash["otter_responses"]["response"]["error"]
|
79
|
+
raise ResponseError.new(bliptv_error_message(response_error))
|
80
|
+
end
|
81
|
+
rescue # we don't care if it fails, that means it works
|
79
82
|
end
|
80
83
|
response_hash["post_url"] = raw_response.match(/\d{3,12}/)[0] # extracts the post_url, since from_xml isn't grabbing it
|
81
84
|
response_hash
|