Permalink
Browse files

cleared trash code

  • Loading branch information...
1 parent 03193bb commit c14cdd33491553710a3f204201fe9990104fb81d @sharipov-ru sharipov-ru committed Apr 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 espn_nhl_parser.rb
View
@@ -7,8 +7,7 @@
doc = Nokogiri::HTML(open(url))
doc.css("div.game-header").each do |gametable| # gametable - html table of current game
- unless gametable.at_css("tr.loser a").nil? # if game not started
- game_info = gametable.at_css("ul.game-info li").text.scan(/OT|SO/).to_s
+ unless gametable.at_css("tr.loser a").nil? # if game not started then skip
loser = gametable.at_css("tr.loser a").text
winner = gametable.at_css("tr.winner a").text
winner_place = gametable.at_css("tr.winner")[:id].scan(/home|away/)
@@ -17,6 +16,7 @@
score << team_score.text
end
result = "#{score[1]}:#{score[0]}" # Away team - Home team
+ game_info = gametable.at_css("ul.game-info li").text.scan(/OT|SO/).to_s
if winner_place.to_s == "home"
game = "#{winner}-#{loser} #{result} #{game_info}"
else

0 comments on commit c14cdd3

Please sign in to comment.