gravis-floobs 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.
@@ -0,0 +1,3 @@
1
+ == 0.1, released 2009-03-01
2
+
3
+ * Initial release
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Philippe Lafoucrière
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,25 @@
1
+ = Floobs API Gem
2
+
3
+ This gem implements a full-featured ruby interface for the Floobs API. It was inspired from Matt Hooks work on vimeo API gem.
4
+
5
+ == Install
6
+
7
+ If you haven't already, add github's gem server to your sources:
8
+
9
+ gem sources -a http://gems.github.com
10
+
11
+ Then, it's as easy as:
12
+
13
+ sudo gem install gravis-floobs
14
+
15
+ Add the gem plugin to your Rails project by adding the following to your @environment.rb@ file:
16
+
17
+ config.gem "gravis-floobs", :lib => "floobs"
18
+
19
+ == Usage
20
+
21
+ You don't need an API key for simple queries.
22
+
23
+ === Floobs::Clip
24
+ === Floobs::Playlist
25
+ === Floobs::Channel
@@ -0,0 +1,5 @@
1
+ == TODO
2
+
3
+ * Registration (URL: http://api.floobs.com/registration.service)
4
+ * Activation (URL: http://api.floobs.com/activation.service)
5
+ * Find a way to mock tests
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 1
4
+ :patch: 1
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'httparty'
3
+ require 'digest/md5'
4
+ require 'cgi'
5
+
6
+ $:.unshift(File.dirname(__FILE__))
7
+ require 'floobs/base'
8
+ require 'floobs/clip'
9
+ require 'floobs/channel'
10
+ require 'floobs/playlist'
11
+ # require 'floobs/upload'
12
+ # require 'floobs/cameraembed'
13
+
14
+ module Floobs
15
+
16
+ end
@@ -0,0 +1,12 @@
1
+ module Floobs
2
+ class Base
3
+ include HTTParty
4
+ base_uri 'api.floobs.com'
5
+
6
+ def initialize(api_key, format_options={})
7
+ # needed for upload
8
+ @auth = { :api_key => api_key }
9
+ end
10
+
11
+ end
12
+ end # Floobs
@@ -0,0 +1,21 @@
1
+ module Floobs
2
+ class Channel < Floobs::Base
3
+
4
+ def self.find(channel_id,live=true)
5
+ get("/channels.service", :query => {:id => channel_id.to_a.join(' or '), :live => live})
6
+ end
7
+
8
+ def self.find_all_by_user_name(username,live=true)
9
+ get("/channels.service", :query => {:userName => username.to_a.join(' or '), :live => live})
10
+ end
11
+
12
+ def self.find_all_by_channel_name(channel_name,live=true)
13
+ get("/channels.service", :query => {:channelName => channel_name.to_a.join(' or '), :live => live})
14
+ end
15
+
16
+ def self.find_all_by_tag(tags,live=true)
17
+ get("/channels.service", :query => {:tag => tags.to_a.join(' and '), :live => live})
18
+ end
19
+
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ module Floobs
2
+ class Clip < Floobs::Base
3
+
4
+ def self.find(video_id)
5
+ get("/clips.service", :query => {:id => video_id.to_a.join(' or ')})
6
+ end
7
+
8
+ def self.find_all_by_user_name(username)
9
+ get("/clips.service", :query => {:userName => username.to_a.join(' or ')})
10
+ end
11
+
12
+ def self.find_all_by_channel_name(channel)
13
+ get("/clips.service", :query => {:channelName => channel.to_a.join(' or ')})
14
+ end
15
+
16
+ def self.find_all_by_tag(tags)
17
+ get("/clips.service", :query => {:tag => tags.to_a.join(' and ')})
18
+ end
19
+ end
20
+ end # End Floobs
@@ -0,0 +1,9 @@
1
+ module Floobs
2
+ class Playlist < Floobs::Base
3
+
4
+ def self.find_by_chanel(channel_id)
5
+ get("/playlists.service", :query => {:channelId => channel_id.to_a.join(' or ')})
6
+ end
7
+
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class ClipTest < Test::Unit::TestCase
4
+
5
+ should "find clips by id" do
6
+
7
+ end
8
+
9
+ end
10
+
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+
3
+ class FloobsTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+ require 'mocha'
5
+ require File.dirname(__FILE__) + '../lib/floobs/floobs'
6
+
7
+ class Test::Unit::TestCase
8
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gravis-floobs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Philippe Lafoucriere
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-03 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: jnunemaker-httparty
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.2.6
24
+ version:
25
+ description: A full featured Ruby implementation of the Floobs API.
26
+ email: philippe.lafoucriere@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.rdoc
33
+ - LICENSE
34
+ - CHANGELOG.rdoc
35
+ files:
36
+ - CHANGELOG.rdoc
37
+ - README.rdoc
38
+ - TODO.rdoc
39
+ - VERSION.yml
40
+ - lib/floobs
41
+ - lib/floobs/base.rb
42
+ - lib/floobs/channel.rb
43
+ - lib/floobs/clip.rb
44
+ - lib/floobs/playlist.rb
45
+ - lib/floobs.rb
46
+ - test/floobs
47
+ - test/floobs/clip_test.rb
48
+ - test/floobs_test.rb
49
+ - test/test_helper.rb
50
+ - LICENSE
51
+ has_rdoc: true
52
+ homepage: http://github.com/gravis/floobs
53
+ post_install_message:
54
+ rdoc_options:
55
+ - --main
56
+ - README.rdoc
57
+ - --inline-source
58
+ - --charset=UTF-8
59
+ - --inline-source
60
+ - --charset=UTF-8
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ requirements: []
76
+
77
+ rubyforge_project:
78
+ rubygems_version: 1.2.0
79
+ signing_key:
80
+ specification_version: 2
81
+ summary: A full featured Ruby implementation of the Floobs API.
82
+ test_files: []
83
+