redtube 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in redtube.gemspec
4
+ gemspec
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,7 @@
1
+ require 'open-uri'
2
+ require 'nokogiri'
3
+
4
+ require 'redtube/video'
5
+
6
+ module Redtube
7
+ end
@@ -0,0 +1,3 @@
1
+ module Redtube
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,32 @@
1
+ module Redtube
2
+ class Video
3
+ attr_accessor :id, :duration, :views, :rating, :ratings, :title, :url, :thumb
4
+
5
+ def self.find(id)
6
+ find_by_query("getVideoById&video_id=#{id}").first
7
+ end
8
+
9
+ def self.search(term)
10
+ find_by_query "searchVideos&search=#{term}"
11
+ end
12
+
13
+ def initialize(video)
14
+ @id = video["video_id"]
15
+ %w(duration views rating ratings title url thumb).each { |name| send "#{name}=", video[name] }
16
+ end
17
+
18
+ private
19
+
20
+ def self.find_by_query(query)
21
+ videos_by_query(query).map { |video| new video }
22
+ end
23
+
24
+ def videos_by_query(query)
25
+ Nokogiri::XML(get(query)).css "video"
26
+ end
27
+
28
+ def self.get(query)
29
+ open("http://api.redtube.com/?output=xml&data=redtube.Videos.#{query}").read
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "redtube/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "redtube"
7
+ s.version = Redtube::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Diego Carrion"]
10
+ s.email = ["dc.rec1@gmail.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Ruby interface to the Redtube API}
13
+ s.description = %q{Ruby interface to the Redtube API}
14
+
15
+ s.rubyforge_project = "redtube"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_runtime_dependency "nokogiri"
23
+
24
+ s.add_development_dependency "rspec"
25
+ s.add_development_dependency "fakeweb"
26
+ end
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="yes"?><video duration="8:18" views="648361" video_id="15485" rating="3.84" ratings="880" title="Sucking chocolate stick" url="http://www.redtube.com/15485" thumb="http://img02.redtubefiles.com/_thumbs/0000015/0015485/0015485_001.jpg"><tags><tag>Couple</tag><tag>Oral Sex</tag><tag>Brunette</tag><tag>Caucasian</tag><tag>Interracial</tag><tag>Blowjob</tag><tag>Cum Shot</tag><tag>Outdoor</tag></tags></video>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="yes"?><root><count>1905</count><videos><video duration="5:00" views="611485" video_id="46653" rating="4.28" ratings="627" title="Noble lesbians in heat 2" url="http://www.redtube.com/46653" thumb="http://img03.redtubefiles.com/_thumbs/0000046/0046653/0046653_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Glamour]]></tag><tag><![CDATA[Pornstar]]></tag><tag><![CDATA[High Heels]]></tag></tags><stars><star><![CDATA[Kayla Paige]]></star><star><![CDATA[Tori Lane]]></star><star><![CDATA[Tory Lane]]></star></stars></video><video duration="6:06" views="450094" video_id="43843" rating="4.13" ratings="503" title="Sandy and Suzy love luxury and sun" url="http://www.redtube.com/43843" thumb="http://img02.redtubefiles.com/_thumbs/0000043/0043843/0043843_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Anal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Glamour]]></tag><tag><![CDATA[Pornstar]]></tag><tag><![CDATA[Pool]]></tag><tag><![CDATA[Bikini]]></tag><tag><![CDATA[Sandra Shine]]></tag><tag><![CDATA[Outdoor]]></tag></tags></video><video duration="42:25" views="2387746" video_id="35399" rating="4.40" ratings="2484" title="La blue girl dealing with a rival" url="http://www.redtube.com/35399" thumb="http://img02.redtubefiles.com/_thumbs/0000035/0035399/0035399_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Vaginal Sex]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Anal Sex]]></tag><tag><![CDATA[Double Penetration]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Blowjob]]></tag><tag><![CDATA[Hentai]]></tag></tags></video><video duration="30:54" views="1231662" video_id="42188" rating="4.25" ratings="1465" title="Nyomi and Candace play with their toys" url="http://www.redtube.com/42188" thumb="http://img02.redtubefiles.com/_thumbs/0000042/0042188/0042188_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Big Tits]]></tag><tag><![CDATA[Ebony]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Shaved]]></tag><tag><![CDATA[Pornstar]]></tag><tag><![CDATA[Strap-on]]></tag></tags><stars><star><![CDATA[Candace Von]]></star><star><![CDATA[Nyomi]]></star><star><![CDATA[ Naomi]]></star><star><![CDATA[Nyomi Banxxx]]></star><star><![CDATA[ Naomi Knoxxx]]></star><star><![CDATA[Candise]]></star><star><![CDATA[ Candace]]></star><star><![CDATA[ Naomi Bankxx]]></star><star><![CDATA[ Candice Von]]></star><star><![CDATA[ Nyaomi Banxxx]]></star><star><![CDATA[ Naomi Banks]]></star><star><![CDATA[ Naomi Banxxx]]></star><star><![CDATA[ Candice]]></star></stars></video><video duration="22:41" views="1215116" video_id="19161" rating="3.96" ratings="1212" title="Blond slave has to please mistresses " url="http://www.redtube.com/19161" thumb="http://img03.redtubefiles.com/_thumbs/0000019/0019161/0019161_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Domination]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Big Tits]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Ebony]]></tag><tag><![CDATA[Anal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Glamour]]></tag><tag><![CDATA[Spanking]]></tag><tag><![CDATA[High Heels]]></tag><tag><![CDATA[Fetish]]></tag><tag><![CDATA[Boots]]></tag></tags></video><video duration="18:44" views="2052898" video_id="34990" rating="4.41" ratings="1440" title="Cytherea super squirting hottie 1" url="http://www.redtube.com/34990" thumb="http://img03.redtubefiles.com/_thumbs/0000034/0034990/0034990_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Asian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Piercings]]></tag><tag><![CDATA[Squirting]]></tag></tags><stars><star><![CDATA[Cytheria]]></star><star><![CDATA[Cytherea]]></star><star><![CDATA[ Cyntheria]]></star></stars></video><video duration="5:48" views="849147" video_id="36767" rating="4.43" ratings="951" title="Forbidden fruits" url="http://www.redtube.com/36767" thumb="http://img01.redtubefiles.com/_thumbs/0000036/0036767/0036767_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Vaginal Sex]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Anal Sex]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Anal Masturbation]]></tag><tag><![CDATA[Shaved]]></tag><tag><![CDATA[Piercings]]></tag><tag><![CDATA[Pornstar]]></tag><tag><![CDATA[Strap-on]]></tag><tag><![CDATA[Boots]]></tag><tag><![CDATA[Nikki Montana]]></tag></tags><stars><star><![CDATA[ Niki Baum]]></star><star><![CDATA[ Nicoletta Smile]]></star><star><![CDATA[ Nikki M.]]></star><star><![CDATA[ Nicole]]></star><star><![CDATA[ Veronika]]></star><star><![CDATA[ Niki Manson]]></star><star><![CDATA[ Dana V.]]></star><star><![CDATA[Dana Kelly]]></star><star><![CDATA[ Dana]]></star><star><![CDATA[ Mikky]]></star><star><![CDATA[ Nicolette]]></star><star><![CDATA[Veronica Ryan]]></star><star><![CDATA[ Sonia Blera or Veronique Saintclair or Sonia Bragas]]></star><star><![CDATA[ Nikolett]]></star><star><![CDATA[ Nikky Montana]]></star><star><![CDATA[ Liza]]></star><star><![CDATA[ Niky Manson]]></star><star><![CDATA[ Nikoletta Angel]]></star><star><![CDATA[ Niky Mo]]></star></stars></video><video duration="21:44" views="931063" video_id="37837" rating="4.31" ratings="1104" title="Busty cute bikini babes love oil and skin" url="http://www.redtube.com/37837" thumb="http://img02.redtubefiles.com/_thumbs/0000037/0037837/0037837_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Big Tits]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Bikini]]></tag></tags><stars><star><![CDATA[Kennedy]]></star><star><![CDATA[Aria Giovanni]]></star><star><![CDATA[Jelena Jensen]]></star></stars></video><video duration="7:54" views="1302605" video_id="36774" rating="4.45" ratings="1545" title="Brunette on raven" url="http://www.redtube.com/36774" thumb="http://img01.redtubefiles.com/_thumbs/0000036/0036774/0036774_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Position 69]]></tag><tag><![CDATA[Kissing]]></tag><tag><![CDATA[Lingerie]]></tag></tags></video><video duration="8:00" views="1349571" video_id="30322" rating="4.58" ratings="2128" title="Lisa and Eve love kissing" url="http://www.redtube.com/30322" thumb="http://img01.redtubefiles.com/_thumbs/0000030/0030322/0030322_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Kissing]]></tag><tag><![CDATA[Shaved]]></tag><tag><![CDATA[Pornstar]]></tag><tag><![CDATA[Lingerie]]></tag></tags><stars><star><![CDATA[ Eva Shine]]></star><star><![CDATA[ Katie]]></star><star><![CDATA[ Monalisa]]></star><star><![CDATA[ Silvia]]></star><star><![CDATA[ Sylvia]]></star><star><![CDATA[ Severine]]></star><star><![CDATA[ Zsilvia]]></star><star><![CDATA[ Sevrine]]></star><star><![CDATA[Cameron Cruz]]></star><star><![CDATA[ Shannon]]></star><star><![CDATA[ Vicky Broone]]></star><star><![CDATA[ Szilvia Loressi]]></star><star><![CDATA[Eve Angel]]></star><star><![CDATA[ Szilvi]]></star><star><![CDATA[ Mono Lisa]]></star><star><![CDATA[Cameron Cruize]]></star><star><![CDATA[ Liza]]></star><star><![CDATA[ Mona]]></star><star><![CDATA[ Cameron Cruise]]></star><star><![CDATA[Seurine]]></star><star><![CDATA[ Lisa]]></star><star><![CDATA[ Eva]]></star><star><![CDATA[ Vicki Broone]]></star></stars></video><video duration="5:10" views="643874" video_id="36352" rating="4.25" ratings="560" title="Three pornbabe screamers in lust" url="http://www.redtube.com/36352" thumb="http://img03.redtubefiles.com/_thumbs/0000036/0036352/0036352_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Piercings]]></tag><tag><![CDATA[Pornstar]]></tag><tag><![CDATA[Stockings]]></tag><tag><![CDATA[Lingerie]]></tag></tags><stars><star><![CDATA[Amy Reid]]></star><star><![CDATA[Amy Ried]]></star><star><![CDATA[ Devin Valencia]]></star><star><![CDATA[Eva Angelina]]></star><star><![CDATA[ Angelina Del Mar]]></star><star><![CDATA[Ava]]></star></stars></video><video duration="8:00" views="1651145" video_id="31023" rating="4.58" ratings="2278" title="Cutie with amazing natural breasts" url="http://www.redtube.com/31023" thumb="http://img03.redtubefiles.com/_thumbs/0000031/0031023/0031023_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Kissing]]></tag><tag><![CDATA[Pornstar]]></tag></tags><stars><star><![CDATA[ Veronika]]></star><star><![CDATA[ Afrodite Night]]></star><star><![CDATA[Aphrodite]]></star><star><![CDATA[Aphrodite Night]]></star><star><![CDATA[ Dana V.]]></star><star><![CDATA[Dana Kelly]]></star><star><![CDATA[ Dana]]></star><star><![CDATA[ Marie]]></star><star><![CDATA[Veronica Ryan]]></star><star><![CDATA[ Liza]]></star><star><![CDATA[ Vera V.]]></star><star><![CDATA[ Vera]]></star></stars></video><video duration="3:00" views="627539" video_id="22676" rating="4.06" ratings="641" title="Slutty chicks Julie and Tarra 2" url="http://www.redtube.com/22676" thumb="http://img03.redtubefiles.com/_thumbs/0000022/0022676/0022676_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Anal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Kissing]]></tag><tag><![CDATA[Piercings]]></tag><tag><![CDATA[Pornstar]]></tag></tags><stars><star><![CDATA[ Chrissy Years Active: 2005-2010]]></star><star><![CDATA[ Tarra Light]]></star><star><![CDATA[ Lucie]]></star><star><![CDATA[Tarra White]]></star><star><![CDATA[ Marianna]]></star><star><![CDATA[ Tara White]]></star><star><![CDATA[ Julia Desiree]]></star><star><![CDATA[Melissa Tiger]]></star><star><![CDATA[ Julie Silvers]]></star><star><![CDATA[ Julia Silven]]></star><star><![CDATA[ Susie]]></star><star><![CDATA[Julie Silver]]></star><star><![CDATA[ July Silver]]></star><star><![CDATA[ Julia Silver]]></star><star><![CDATA[ Lucy David]]></star><star><![CDATA[ Janet]]></star></stars></video><video duration="18:07" views="869469" video_id="19294" rating="4.24" ratings="859" title="Watching lesbian teens" url="http://www.redtube.com/19294" thumb="http://img01.redtubefiles.com/_thumbs/0000019/0019294/0019294_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Teen]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Small Tits]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Maid]]></tag></tags></video><video duration="7:27" views="574169" video_id="12295" rating="3.39" ratings="712" title="Lesbians enjoy their time together 1" url="http://www.redtube.com/12295" thumb="http://img01.redtubefiles.com/_thumbs/0000012/0012295/0012295_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Kissing]]></tag><tag><![CDATA[High Heels]]></tag></tags></video><video duration="12:53" views="666845" video_id="20495" rating="4.13" ratings="693" title="Lesbians living agressions against men" url="http://www.redtube.com/20495" thumb="http://img02.redtubefiles.com/_thumbs/0000020/0020495/0020495_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Strap-on]]></tag></tags></video><video duration="6:36" views="4033669" video_id="200" rating="4.36" ratings="7299" title="Gorgeous fetish girls" url="http://www.redtube.com/200" thumb="http://img01.redtubefiles.com/_thumbs/0000000/0000200/0000200_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Domination]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Big Tits]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Toys]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Glamour]]></tag><tag><![CDATA[Stockings]]></tag><tag><![CDATA[Lingerie]]></tag><tag><![CDATA[Classic]]></tag><tag><![CDATA[Rimming]]></tag><tag><![CDATA[High Heels]]></tag><tag><![CDATA[Fetish]]></tag></tags></video><video duration="17:07" views="13525716" video_id="8428" rating="4.61" ratings="65697" title="Sexy lesbians playing by the fireside" url="http://www.redtube.com/8428" thumb="http://img02.redtubefiles.com/_thumbs/0000008/0008428/0008428_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Teen]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Vaginal Masturbation]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Shaved]]></tag><tag><![CDATA[Piercings]]></tag><tag><![CDATA[Glamour]]></tag><tag><![CDATA[Pornstar]]></tag></tags><stars><star><![CDATA[ Sarah]]></star><star><![CDATA[Joey]]></star><star><![CDATA[Sarah Blake]]></star><star><![CDATA[ Sarah Blue]]></star><star><![CDATA[Laine]]></star><star><![CDATA[Charlie Laine]]></star><star><![CDATA[ Charlie]]></star><star><![CDATA[ Charlie Lane]]></star></stars></video><video duration="2:46" views="1871286" video_id="7781" rating="4.28" ratings="2142" title="Huge breasts and two sluts" url="http://www.redtube.com/7781" thumb="http://img01.redtubefiles.com/_thumbs/0000007/0007781/0007781_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Mature]]></tag><tag><![CDATA[Brunette]]></tag><tag><![CDATA[Redhead]]></tag><tag><![CDATA[Big Tits]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Stockings]]></tag></tags></video><video duration="12:02" views="3132252" video_id="2097" rating="4.43" ratings="7655" title="Lesbian slave getting fucked in bondage" url="http://www.redtube.com/2097" thumb="http://img03.redtubefiles.com/_thumbs/0000002/0002097/0002097_001.jpg"><tags><tag><![CDATA[Lesbian]]></tag><tag><![CDATA[Vaginal Sex]]></tag><tag><![CDATA[Masturbation]]></tag><tag><![CDATA[Oral Sex]]></tag><tag><![CDATA[Blonde]]></tag><tag><![CDATA[Black-haired]]></tag><tag><![CDATA[Caucasian]]></tag><tag><![CDATA[Blowjob]]></tag><tag><![CDATA[Licking Vagina]]></tag><tag><![CDATA[Kissing]]></tag><tag><![CDATA[Piercings]]></tag><tag><![CDATA[Tattoos]]></tag><tag><![CDATA[Glamour]]></tag></tags></video></videos></root>
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'redtube' # and any other gems you need
5
+ require 'fakeweb'
6
+
7
+ RSpec.configure do |config|
8
+ # some (optional) config here
9
+ end
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ def response(name)
4
+ File.open("#{File.dirname(__FILE__)}/responses/#{name}.xml").read
5
+ end
6
+
7
+ FakeWeb.allow_net_connect = false
8
+ FakeWeb.register_uri(:get, "http://api.redtube.com/?output=xml&data=redtube.Videos.getVideoById&video_id=15485", :body => response("getVideoById"))
9
+ FakeWeb.register_uri(:get, "http://api.redtube.com/?output=xml&data=redtube.Videos.searchVideos&search=lesbian", :body => response("searchVideos"))
10
+
11
+ describe Redtube::Video do
12
+ describe ".find" do
13
+ let(:subject) { Redtube::Video.find(15485) }
14
+
15
+ it "should return a video" do
16
+ subject.should be_a(Redtube::Video)
17
+ end
18
+
19
+ { 'duration' => '8:18', 'id' => '15485', 'title' => 'Sucking chocolate stick', 'url' => 'http://www.redtube.com/15485' }.each do |name, value|
20
+ it "should return the #{name}" do
21
+ subject.send(name).should == value
22
+ end
23
+ end
24
+
25
+ %w(rating ratings views thumb).each do |name|
26
+ it "should return the #{name}" do
27
+ subject.send(name).should_not be_nil
28
+ end
29
+ end
30
+ end
31
+
32
+ describe ".search" do
33
+ let(:subject) { Redtube::Video.search("lesbian") }
34
+
35
+ it "should return an array of videos" do
36
+ subject.size.should == 20
37
+ end
38
+ end
39
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: redtube
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Diego Carrion
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-06-02 00:00:00 -03:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: nokogiri
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :development
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: fakeweb
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :development
62
+ version_requirements: *id003
63
+ description: Ruby interface to the Redtube API
64
+ email:
65
+ - dc.rec1@gmail.com
66
+ executables: []
67
+
68
+ extensions: []
69
+
70
+ extra_rdoc_files: []
71
+
72
+ files:
73
+ - .gitignore
74
+ - .rspec
75
+ - Gemfile
76
+ - Rakefile
77
+ - lib/redtube.rb
78
+ - lib/redtube/version.rb
79
+ - lib/redtube/video.rb
80
+ - redtube.gemspec
81
+ - spec/responses/getVideoById.xml
82
+ - spec/responses/searchVideos.xml
83
+ - spec/spec_helper.rb
84
+ - spec/videos_spec.rb
85
+ has_rdoc: true
86
+ homepage: ""
87
+ licenses: []
88
+
89
+ post_install_message:
90
+ rdoc_options: []
91
+
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ hash: 3
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ hash: 3
109
+ segments:
110
+ - 0
111
+ version: "0"
112
+ requirements: []
113
+
114
+ rubyforge_project: redtube
115
+ rubygems_version: 1.5.3
116
+ signing_key:
117
+ specification_version: 3
118
+ summary: Ruby interface to the Redtube API
119
+ test_files:
120
+ - spec/responses/getVideoById.xml
121
+ - spec/responses/searchVideos.xml
122
+ - spec/spec_helper.rb
123
+ - spec/videos_spec.rb