harunica 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc57b37d7333f8c6ffc61d6ea007c3f531fb1d37
4
- data.tar.gz: e0b398ca645b1fafb851d7c71fb587bbdbb89c4c
3
+ metadata.gz: 3fb99a2e1aae906ff21da91d172ad06caf8be866
4
+ data.tar.gz: 4843a6ce8ed8fe305fbedff69f895fa109440601
5
5
  SHA512:
6
- metadata.gz: c564b55142637589809e7c135a3dbb2f294129ffe25dba7e2cbcc50efd8201f906063b41bb71cd6fbc7f9c67e1fa3d97a630fd8281790e36e539eea5370a6b37
7
- data.tar.gz: 416d39557acfcb5951fb6b15453d60f4e032c5f626e322c9fa67e9a9b962c18479d3995beca13b9500d5a8737c8ede56d478a5af0ab26f718a30d41825e68094
6
+ metadata.gz: 56f209aa18c8c22683c9223469e913fe5db031f8bfa2371ba9833e52905050e2e440da2471a0b287797685354cadc91ce6e722e54a28051c00271bfa28b1625b
7
+ data.tar.gz: 8906adaa556c268ead5e1a43de586adaeb67b260fdb300bf64164574a1c2f8d1a1eafb2fff06b06c1cca00ea94bd8fb082ee5c0ebe9fe7b37c23442b248902c4
@@ -31,7 +31,8 @@ module Harunica
31
31
  def video_pages
32
32
  @video_pages ||= html.doc.css(VIDEO_SELECTORS.join(' ')).map do |e|
33
33
  url = html.url.base + e.css('.itemContent .itemTitle a')[0].attr('href')
34
- VideoPage.new(Html.new(url))
34
+ thumb_url = e.css('.videoList01Wrap .uadWrap .itemThumbBox .thumb')[0].attr('src')
35
+ VideoPage.new(Html.new(url), thumb_url)
35
36
  end
36
37
  end
37
38
 
@@ -9,15 +9,38 @@ module Harunica
9
9
  'strong[itemprop="name"]'
10
10
  ]
11
11
 
12
- attr_reader :html
12
+ TITLE_SELECTORS = [
13
+ 'head',
14
+ 'meta[property="og:title"]'
15
+ ]
16
+
17
+ DESC_SELECTORS = [
18
+ '#des_short',
19
+ 'p:last-child'
20
+ ]
13
21
 
14
- def initialize(html)
22
+ attr_reader :html, :thumbnail_url
23
+
24
+ def initialize(html, thumbnail_url)
15
25
  @html = html
26
+ @thumbnail_url = thumbnail_url
16
27
  end
17
28
 
18
29
  def author
19
30
  @author ||= html.doc.css(AUTHOR_SELECTORS.join(' '))[0].content
20
31
  end
32
+
33
+ def title
34
+ @title ||= html.doc.css(TITLE_SELECTORS.join(' '))[0].attr('content')
35
+ end
36
+
37
+ def description
38
+ @description ||= html.doc.css(DESC_SELECTORS.join(' '))[0].content
39
+ end
40
+
41
+ def url
42
+ html.url
43
+ end
21
44
  end
22
45
  end
23
46
  end
@@ -1,3 +1,3 @@
1
1
  module Harunica
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harunica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mosop