18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/live_soccer/checker.rb', line 18
def self.parse_matches
[].tap do |matches|
self.each_match do |match|
date = "#{match.soccer_value 'li.noticia_dia'} #{match.soccer_value 'li.noticia_hora'} -03:00"
matches << { date: DateTime.parse(date),
home: match.soccer_value('div.jogo td.time1'),
visitor: match.soccer_value('div.jogo td.time2'),
score: match.css('div.jogo td.placar').last.content.strip,
id: match.css('div.jogo td.placar a').first && match.css('div.jogo td.placar a').first.attributes["href"].value.split("id=").last }
end
end
end
|