xvideos_helper 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/xvideos_helper/crawler.rb +4 -1
- data/lib/xvideos_helper/version.rb +1 -1
- data/spec/lib/client_spec.rb +4 -1
- data/spec/lib/crawler_spec.rb +4 -1
- metadata +8 -2
data/README.md
CHANGED
@@ -6,6 +6,7 @@ XvideosHelper is a gem to support for adult site creater.This gem provides xvide
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
+
gem 'nokogiri'
|
9
10
|
gem 'xvideos_helper'
|
10
11
|
|
11
12
|
And then execute:
|
@@ -36,6 +37,7 @@ Or install it yourself as:
|
|
36
37
|
"movie_url" => "http://flashservice.xvideos.com/embedframe/6243093",
|
37
38
|
"movie_page_url"=> "http://jp.xvideos.com/video2017657/0/jp_kyoko_ayana_qc05-02_by_zeus4096_asian_cumshots_asian_swallow_japanese_chinese",
|
38
39
|
"movie_thumnail_url"=> "http://img100.xvideos.com/videos/thumbs/46/a0/69/46a069b72731e3c22ddf917d9fb1cbca/46a069b72731e3c22ddf917d9fb1cbca.4.jpg",
|
40
|
+
"movie_id"=>"9750364",
|
39
41
|
"description"=>"Jp Kyoko Ayana Qc05-02 By Zeus4096 asian ...",
|
40
42
|
"duration"=>"(19min)",
|
41
43
|
"movie_quality"=>"Pornquality:98%"
|
@@ -59,6 +59,9 @@ private
|
|
59
59
|
parsed_data[index]['description'] = (elm.children[0].content.match(/<p><a href=".+">(.+)<\/a><\/p>/))[1]
|
60
60
|
end
|
61
61
|
|
62
|
+
# movie_id
|
63
|
+
parsed_data[index]['movie_id'] = parsed_data[index]['movie_page_url'].match(/\/video(\d+)\/.*/)[1]
|
64
|
+
|
62
65
|
# iframe url
|
63
66
|
parsed_data[index]['movie_url'] = @iframe_url + (parsed_data[index]['movie_page_url'].match(/\/video(\d+)\/.*/))[1]
|
64
67
|
|
@@ -102,4 +105,4 @@ private
|
|
102
105
|
return parsed_data
|
103
106
|
end
|
104
107
|
end
|
105
|
-
end
|
108
|
+
end
|
data/spec/lib/client_spec.rb
CHANGED
@@ -10,6 +10,7 @@ describe "XvideosHelper::Client" do
|
|
10
10
|
list["movie_url"].should match(/^http:\/\/.+\/\d+$/)
|
11
11
|
list["movie_page_url"].should match(/^http:\/\/.+/)
|
12
12
|
list["movie_thumnail_url"].should match(/^http:\/\/.+/)
|
13
|
+
list["movie_id"].should_not be_nil
|
13
14
|
list["description"].should_not be_nil
|
14
15
|
list["duration"].should_not be_nil
|
15
16
|
list["movie_quality"].should_not be_nil
|
@@ -50,6 +51,7 @@ describe "XvideosHelper::Client" do
|
|
50
51
|
list["movie_url"].should match(/^http:\/\/.+\/\d+$/)
|
51
52
|
list["movie_page_url"].should match(/^http:\/\/.+/)
|
52
53
|
list["movie_thumnail_url"].should match(/^http:\/\/.+/)
|
54
|
+
list["movie_id"].should_not be_nil
|
53
55
|
list["description"].should_not be_nil
|
54
56
|
list["duration"].should_not be_nil
|
55
57
|
list["movie_quality"].should_not be_nil
|
@@ -65,6 +67,7 @@ describe "XvideosHelper::Client" do
|
|
65
67
|
list["movie_url"].should match(/^http:\/\/.+\/\d+$/)
|
66
68
|
list["movie_page_url"].should match(/^http:\/\/.+/)
|
67
69
|
list["movie_thumnail_url"].should match(/^http:\/\/.+/)
|
70
|
+
list["movie_id"].should_not be_nil
|
68
71
|
list["description"].should_not be_nil
|
69
72
|
list["duration"].should_not be_nil
|
70
73
|
list["movie_quality"].should_not be_nil
|
@@ -96,4 +99,4 @@ describe "XvideosHelper::Client" do
|
|
96
99
|
end
|
97
100
|
end
|
98
101
|
|
99
|
-
end
|
102
|
+
end
|
data/spec/lib/crawler_spec.rb
CHANGED
@@ -10,6 +10,7 @@ describe "XvideosHelper::Crawler" do
|
|
10
10
|
list["movie_url"].should match(/^http:\/\/.+\/\d+$/)
|
11
11
|
list["movie_page_url"].should match(/^http:\/\/.+/)
|
12
12
|
list["movie_thumnail_url"].should match(/^http:\/\/.+/)
|
13
|
+
list["movie_id"].should_not be_nil
|
13
14
|
list["description"].should_not be_nil
|
14
15
|
list["duration"].should_not be_nil
|
15
16
|
list["movie_quality"].should_not be_nil
|
@@ -25,6 +26,7 @@ describe "XvideosHelper::Crawler" do
|
|
25
26
|
list["movie_url"].should match(/^http:\/\/.+\/\d+$/)
|
26
27
|
list["movie_page_url"].should match(/^http:\/\/.+/)
|
27
28
|
list["movie_thumnail_url"].should match(/^http:\/\/.+/)
|
29
|
+
list["movie_id"].should_not be_nil
|
28
30
|
list["description"].should_not be_nil
|
29
31
|
list["duration"].should_not be_nil
|
30
32
|
list["movie_quality"].should_not be_nil
|
@@ -40,6 +42,7 @@ describe "XvideosHelper::Crawler" do
|
|
40
42
|
list["movie_url"].should match(/^http:\/\/.+\/\d+$/)
|
41
43
|
list["movie_page_url"].should match(/^http:\/\/.+/)
|
42
44
|
list["movie_thumnail_url"].should match(/^http:\/\/.+/)
|
45
|
+
list["movie_id"].should_not be_nil
|
43
46
|
list["description"].should_not be_nil
|
44
47
|
list["duration"].should_not be_nil
|
45
48
|
list["movie_quality"].should_not be_nil
|
@@ -97,4 +100,4 @@ describe "XvideosHelper::Crawler" do
|
|
97
100
|
end
|
98
101
|
end
|
99
102
|
|
100
|
-
end
|
103
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xvideos_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -114,12 +114,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- - ! '>='
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
hash: 3698011074387602631
|
117
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
121
|
none: false
|
119
122
|
requirements:
|
120
123
|
- - ! '>='
|
121
124
|
- !ruby/object:Gem::Version
|
122
125
|
version: '0'
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
hash: 3698011074387602631
|
123
129
|
requirements: []
|
124
130
|
rubyforge_project:
|
125
131
|
rubygems_version: 1.8.24
|