url_to_contents 0.0.5 → 0.0.6

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/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in url_to_contents.gemspec
4
- gemspec
5
-
6
- gem 'nokogiri', '~>1.5.5'
4
+ gemspec
@@ -4,8 +4,6 @@ require "url_to_contents/site"
4
4
  require "url_to_contents/url"
5
5
  require "url_to_contents/parser"
6
6
 
7
-
8
-
9
7
  module UrlToContents
10
8
  # Your code goes here...
11
9
  end
@@ -1,7 +1,13 @@
1
+ #encoding: utf-8
2
+
1
3
  module UrlToContents
2
4
  module Models
3
5
  class Tudou
4
6
  include UrlToContents::Models::BaseAttributes
7
+
8
+ def service_name
9
+ '土豆网'
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,7 +1,13 @@
1
+ #encoding: utf-8
2
+
1
3
  module UrlToContents
2
4
  module Models
3
5
  class Weibo
4
6
  include UrlToContents::Models::BaseAttributes
7
+
8
+ def service_name
9
+ '新浪微博'
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,7 +1,13 @@
1
+ #encoding: utf-8
2
+
1
3
  module UrlToContents
2
4
  module Models
3
5
  class Youku
4
6
  include UrlToContents::Models::BaseAttributes
7
+
8
+ def service_name
9
+ '优酷'
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -13,8 +13,8 @@ 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
+ youku.title = @doc.css('.title a,#subtitle').text
17
+ youku.content = @doc.css('.right .infoArea .body .info:last-child .item:first-child').text
18
18
  @doc.css('#panel_share > .panel_con > .p1 > .item').each do |u|
19
19
  youku.media = u.xpath('input').attr('value').value if u.css('.label').children.text == "flash地址: "
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module UrlToContents
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -16,4 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency("nokogiri", "~> 1.5.5")
21
+
19
22
  end
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.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-31 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2012-12-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nokogiri
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.5.5
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.5.5
14
30
  description: ! '[""]'
15
31
  email:
16
32
  - skywalker418@gmail.com