harunica 0.0.4 → 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.
- checksums.yaml +4 -4
- data/lib/harunica/scraping/list_page.rb +2 -2
- data/lib/harunica/scraping/video_page.rb +12 -3
- data/lib/harunica/scraping.rb +2 -0
- data/lib/harunica/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28fa99d3a16ff6c0fa57cc7226e7e76a72c047ba
|
4
|
+
data.tar.gz: 132d8844f6f63ee9bab202ff4b454e7d3257b194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e64ac9c09c1b52548cbf53bd9ffc9addf35858ff74bc98e5cc4051df57e2663ee1962db1efce6c9d42feb4962da4d4808d42ffef4b320a671d520230fd1fac7
|
7
|
+
data.tar.gz: d76c1723b7a1f13b04e07fe2bfbb1f72962e319f733053a6f28f69b6db6a86598c85bd2edaaa541fad08f9f97da88ec96d668852d54eda7faa55312b3b51a226
|
@@ -31,8 +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
|
-
|
35
|
-
VideoPage.new(Html.new(url),
|
34
|
+
id = e.css('.videoList01Wrap .uadWrap .itemThumbBox .itemThumb')[0].attr('data-id')
|
35
|
+
VideoPage.new(Html.new(url), id)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -19,11 +19,11 @@ module Harunica
|
|
19
19
|
'p:last-child'
|
20
20
|
]
|
21
21
|
|
22
|
-
attr_reader :html, :
|
22
|
+
attr_reader :html, :id
|
23
23
|
|
24
|
-
def initialize(html,
|
24
|
+
def initialize(html, id)
|
25
25
|
@html = html
|
26
|
-
@
|
26
|
+
@id = id
|
27
27
|
end
|
28
28
|
|
29
29
|
def author
|
@@ -41,6 +41,15 @@ module Harunica
|
|
41
41
|
def url
|
42
42
|
html.url
|
43
43
|
end
|
44
|
+
|
45
|
+
def thumbnail_url
|
46
|
+
@thumbnail_url ||= self.class.id_to_thumbnail_url(id)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.id_to_thumbnail_url(id)
|
50
|
+
/^sm(\d+)$/ =~ id
|
51
|
+
Harunica::Scraping::THUMBNAIL_SERVER_URL + "/smile?i=#{$1}.M"
|
52
|
+
end
|
44
53
|
end
|
45
54
|
end
|
46
55
|
end
|
data/lib/harunica/scraping.rb
CHANGED
data/lib/harunica/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mosop
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.4.
|
128
|
+
rubygems_version: 2.4.5
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Collect and Analyze '春ニカ祭' posts from nicovideo.jp
|