url_to_contents 0.0.3 → 0.0.5
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/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/url_to_contents/models/base_attributes.rb +7 -0
- data/lib/url_to_contents/models/tudou.rb +1 -1
- data/lib/url_to_contents/models/weibo.rb +1 -1
- data/lib/url_to_contents/models/youku.rb +1 -1
- data/lib/url_to_contents/parser.rb +7 -1
- data/lib/url_to_contents/url.rb +1 -0
- data/lib/url_to_contents/version.rb +1 -1
- data/lib/url_to_contents.rb +2 -0
- metadata +3 -1
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/pkg
|
data/Gemfile.lock
CHANGED
@@ -13,8 +13,10 @@ module UrlToContents
|
|
13
13
|
|
14
14
|
def youku
|
15
15
|
youku = UrlToContents::Models::Youku.new
|
16
|
+
youku.title = @doc.css('.title a').text
|
17
|
+
youku.content = @doc.css('.body #long2 .item')[0].text
|
16
18
|
@doc.css('#panel_share > .panel_con > .p1 > .item').each do |u|
|
17
|
-
youku.
|
19
|
+
youku.media = u.xpath('input').attr('value').value if u.css('.label').children.text == "flash地址: "
|
18
20
|
end
|
19
21
|
return youku
|
20
22
|
end
|
@@ -29,6 +31,10 @@ module UrlToContents
|
|
29
31
|
|
30
32
|
def todou
|
31
33
|
end
|
34
|
+
|
35
|
+
def Invalid_url
|
36
|
+
return nil
|
37
|
+
end
|
32
38
|
end
|
33
39
|
|
34
40
|
end
|
data/lib/url_to_contents/url.rb
CHANGED
data/lib/url_to_contents.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_to_contents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,12 +18,14 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
+
- .gitignore
|
21
22
|
- Gemfile
|
22
23
|
- Gemfile.lock
|
23
24
|
- LICENSE.txt
|
24
25
|
- README.md
|
25
26
|
- Rakefile
|
26
27
|
- lib/url_to_contents.rb
|
28
|
+
- lib/url_to_contents/models/base_attributes.rb
|
27
29
|
- lib/url_to_contents/models/tudou.rb
|
28
30
|
- lib/url_to_contents/models/weibo.rb
|
29
31
|
- lib/url_to_contents/models/youku.rb
|