hongkong-news-scrapers 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e996366355f577f87a28c3a3c6da7dd62004d16e
4
- data.tar.gz: a4d784b05c55a00dde32b23d7b362c9e8271e105
3
+ metadata.gz: e238333e49b8d54ace5988eaaddac722470ae09d
4
+ data.tar.gz: 97f7163b2d30d66925d90a0439c63cf84f0c5cf7
5
5
  SHA512:
6
- metadata.gz: f023f63ced3ee5afcc4be55758f7f8e47bda7b42f1526c6a9ab50d75b4da565dcc9393e5d9b1274779249f71bf679be1d101f7978d052c764e962a2554db731c
7
- data.tar.gz: 2cb51fa11ece0d817f4c5686e09b3b2b2e1c54b6b0f2073ead8c45fca23955e2ecd004c53325bee702eaf4a5a9cd08ce1f7119cd5150a46cdeac95bcc57d39aa
6
+ metadata.gz: 66d4f59b6d0c0f65577dc151295c4f5344021dd0c81946f4eaac13303be687b1970a9f3db41525dffbc68890f420dcee96f7c120e6002c5c6f2ecfb4e4de2a53
7
+ data.tar.gz: 886080e21e00a473c437059c8346a66dda82b24241c62c8ce624157a0fa44054881a19d4d36060cf18bea05f36b8b51c1a2a6006310c09253cb516febafa650b
@@ -1,6 +1,6 @@
1
1
  module Hongkong
2
2
  module News
3
- class Document < Struct.new(:id, :source, :title, :url, :html, :content, :screenshot_data, :image_url)
3
+ class Document < Struct.new(:id, :source, :title, :url, :html, :content, :image_url)
4
4
  end
5
5
  end
6
6
  end
@@ -20,8 +20,6 @@ module Hongkong
20
20
  link.url = option["value"]
21
21
  link
22
22
  end.reject { |l| l.url.nil? }
23
-
24
- cleanup
25
23
  links
26
24
  end
27
25
 
@@ -35,10 +33,7 @@ module Hongkong
35
33
  document.url = url
36
34
  document.html = html
37
35
  document.content = page.evaluate_script("HongKongNews.getInnerText('#masterContent')")
38
- document.screenshot_data = screenshot_data
39
36
  document.image_url = doc.search("//meta[@property='og:image']/@content").first.text rescue nil
40
-
41
- cleanup
42
37
  document
43
38
  end
44
39
  end
@@ -23,8 +23,6 @@ module Hongkong
23
23
  link.url = URI::join(LIST_URL, anchor["href"]).to_s
24
24
  link
25
25
  end
26
-
27
- cleanup
28
26
  links
29
27
  end
30
28
 
@@ -41,10 +39,7 @@ module Hongkong
41
39
  document.url = url
42
40
  document.html = html
43
41
  document.content = page.evaluate_script("HongKongNews.getInnerText('article')")
44
- document.screenshot_data = screenshot_data
45
42
  document.image_url = doc.search("//meta[@property='og:image']/@content").first.text rescue nil
46
-
47
- cleanup
48
43
  document
49
44
  end
50
45
  end
@@ -23,8 +23,6 @@ module Hongkong
23
23
  link.url = URI::join(LIST_URL, option["value"]).to_s
24
24
  link
25
25
  end.reject { |l| l.url.to_s.end_with?("#") }
26
-
27
- cleanup
28
26
  links
29
27
  end
30
28
 
@@ -41,12 +39,8 @@ module Hongkong
41
39
  document.url = url
42
40
  document.html = html
43
41
  document.content = page.evaluate_script("HongKongNews.getInnerText('#contentCTN-top')") + "\n" + page.evaluate_script("HongKongNews.getInnerText('#contentCTN-right')")
44
- document.screenshot_data = screenshot_data
45
-
46
42
  image = doc.search("#contentCTN .photo img").first
47
43
  document.image_url = URI::join(url, image["src"]).to_s if image
48
-
49
- cleanup
50
44
  document
51
45
  end
52
46
  end
@@ -1,7 +1,7 @@
1
1
  module Hongkong
2
2
  module News
3
3
  module Scrapers
4
- VERSION = "0.4.3"
4
+ VERSION = "0.5.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hongkong-news-scrapers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Chong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-23 00:00:00.000000000 Z
11
+ date: 2015-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler