afr_load 0.1.1 → 0.1.2
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/afr_load.gemspec +1 -1
- data/lib/afr_load/parser.rb +3 -1
- data/lib/afr_load/tv_program.rb +18 -20
- data/lib/afr_load/version.rb +1 -1
- data/lib/afr_load.rb +0 -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: b9fae81557b0fee6a989620bb980172c37aafc6b
|
4
|
+
data.tar.gz: 1ba181fd0d1914942cc40d9de362d00e1537aa49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f462f792d063226a459690f39217ed1b6748d153d07b6d694a26d7176f3bdc133b3ce9d55d353053c9b14287d508259159cff1c3fa5a1614ad2ab2944b684f4f
|
7
|
+
data.tar.gz: 13fd6b48ae4b946152c37ea9243f19cc038e8f587503943f4bbdfda435d8ea19311f7e45f791e282a5d948060e48e9142f08928794d4709ad2635751c83a8b0e
|
data/afr_load.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["iaia72160@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Web Scraping for 午後のロードショー}
|
13
|
-
spec.description = %q{
|
13
|
+
spec.description = %q{午後ローのウェブスクレイピング。放送日、タイトル、映画に関する情報を取得します。}
|
14
14
|
spec.homepage = ""
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/lib/afr_load/parser.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require "afr_load/tv_program"
|
4
|
+
|
3
5
|
module AfrLoad
|
4
6
|
module Parser
|
5
7
|
class << self
|
@@ -29,7 +31,7 @@ module AfrLoad
|
|
29
31
|
contents_child.xpath("//div/div[@class='gogo_item']").map do |movie_node|
|
30
32
|
data_block = movie_node.at_xpath("div[contains(@class, 'g_data_block')]")
|
31
33
|
year_country = data_block.at_xpath("div/span[@class='g_country_year']").text.split("◆")
|
32
|
-
tv_program = TvProgram
|
34
|
+
tv_program = TvProgram.new(
|
33
35
|
on_air_date: movie_node.at_xpath("span[contains(@class, 'g_day')]").text,
|
34
36
|
title_ja: data_block.at_xpath("h3/span[@class='jp']").text,
|
35
37
|
title: data_block.at_xpath("h3/span[contains(@class, 'en')]").text ,
|
data/lib/afr_load/tv_program.rb
CHANGED
@@ -1,27 +1,26 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module AfrLoad
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
:leading_actor, :supporting_actor
|
4
|
+
class TvProgram
|
5
|
+
attr_reader :on_air_date,
|
6
|
+
:title_ja, :title,
|
7
|
+
:released_year, :released_country,
|
8
|
+
:leading_actor, :supporting_actor
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
def initialize(on_air_date:, title_ja:, title:,
|
11
|
+
released_year:, released_country:,
|
12
|
+
leading_actor:, supporting_actor:)
|
13
|
+
@on_air_date = on_air_date
|
14
|
+
@title_ja = title_ja
|
15
|
+
@title = title
|
16
|
+
@released_year = released_year
|
17
|
+
@released_country = released_country
|
18
|
+
@leading_actor = leading_actor
|
19
|
+
@supporting_actor = supporting_actor
|
20
|
+
end
|
22
21
|
|
23
|
-
|
24
|
-
puts <<"EOS"
|
22
|
+
def show()
|
23
|
+
puts <<"EOS"
|
25
24
|
on_air_date: #{@on_air_date}, \
|
26
25
|
title_ja: #{@title_ja}, \
|
27
26
|
title: #{@title}, \
|
@@ -30,7 +29,6 @@ released_country: #{@released_country}, \
|
|
30
29
|
leading_actor: #{@leading_actor}, \
|
31
30
|
supporting_actor: #{@supporting_actor}
|
32
31
|
EOS
|
33
|
-
end
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
data/lib/afr_load/version.rb
CHANGED
data/lib/afr_load.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: afr_load
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iaia
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description: 午後ローのウェブスクレイピング。放送日、タイトル、映画に関する情報を取得します。
|
84
84
|
email:
|
85
85
|
- iaia72160@gmail.com
|
86
86
|
executables: []
|