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.
- data/CHANGELOG.rdoc +3 -0
- data/LICENSE +20 -0
- data/README.rdoc +25 -0
- data/TODO.rdoc +5 -0
- data/VERSION.yml +4 -0
- data/lib/floobs.rb +16 -0
- data/lib/floobs/base.rb +12 -0
- data/lib/floobs/channel.rb +21 -0
- data/lib/floobs/clip.rb +20 -0
- data/lib/floobs/playlist.rb +9 -0
- data/test/floobs/clip_test.rb +10 -0
- data/test/floobs_test.rb +7 -0
- data/test/test_helper.rb +8 -0
- metadata +83 -0
data/CHANGELOG.rdoc
ADDED
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.
|
data/README.rdoc
ADDED
@@ -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
|
data/TODO.rdoc
ADDED
data/VERSION.yml
ADDED
data/lib/floobs.rb
ADDED
@@ -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
|
data/lib/floobs/base.rb
ADDED
@@ -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
|
data/lib/floobs/clip.rb
ADDED
@@ -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
|
data/test/floobs_test.rb
ADDED
data/test/test_helper.rb
ADDED
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
|
+
|