lib/afr_load/parser.rb in afr_load-0.1.4 vs lib/afr_load/parser.rb in afr_load-0.1.5
- old
+ new
@@ -30,19 +30,19 @@
def parse_month_lineup(contents_child)
contents_child.xpath("//div/div[@class='gogo_item']").map do |movie_node|
data_block = movie_node.at_xpath("div[contains(@class, 'g_data_block')]")
year_country = data_block.at_xpath("div/span[@class='g_country_year']").text.split("◆")
performer = data_block.xpath("div/div/div[2]/span[2]").text
- tv_program = TvProgram.new(
- on_air_date: movie_node.at_xpath("span[contains(@class, 'g_day')]").text,
- title_ja: data_block.at_xpath("h3/span[@class='jp']").text,
- title: data_block.at_xpath("h3/span[contains(@class, 'en')]").text ,
- released_year: year_country[0],
- released_country: year_country[1],
- movie_director: data_block.xpath("div/div/div[1]/span[2]").text,
- leading_actor: performer.split("/")[0],
- supporting_actor: performer.split("/")[1]
- )
+ tv_program = TvProgram.new do |info|
+ info.on_air_date = movie_node.at_xpath("span[contains(@class, 'g_day')]").text
+ info.title_ja = data_block.at_xpath("h3/span[@class='jp']").text
+ info.title = data_block.at_xpath("h3/span[contains(@class, 'en')]").text
+ info.released_year = year_country[0]
+ info.released_country = year_country[1]
+ info.movie_director = data_block.xpath("div/div/div[1]/span[2]").text
+ info.leading_actor = performer.split("/")[0]
+ info.supporting_actor = performer.split("/")[1]
+ end
end
end
end
end
end