Skip to content

Commit

Permalink
Update scraper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
iecaff committed May 17, 2015
1 parent 66af4b3 commit b2ef66c
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions scraper.rb
Expand Up @@ -22,33 +22,24 @@
con_text=con_nodes.map(&:text).delete_if{|x| x !~ /\w/}
con_text.each_with_index do |con_string,i|
case con_string
when 'Area:'
if con_info.has? con_text[i+1]
else puts 'Area: ' + con_string
when 'Ward:'
if con_info.has? con_text[i+1]
else puts 'Ward: ' + con_string
when 'Elected:'
if con_info.has? con_text[i+1]
else puts 'Elected: ' + con_string
when 'Party:'
if con_info.has? con_text[i+1]
else puts 'Party: ' + con_string
when 'Address:'
if con_info.has? con_text[i+1]
else puts 'Address: ' + con_string
when 'Email:'
if con_info.has? con_text[i+1]
else puts 'Email: ' + con_string
when 'Phone:'
if con_info.has? con_text[i+1]
else puts 'Phone: ' + con_string
when 'Mobile:'
if con_info.has? con_text[i+1]
else puts 'Mobile: ' + con_string
when 'Fax:'
if con_info.has? con_text[i+1]
else puts 'Fax: ' + con_string
when 'Area:' && con_info.has? con_text[i+1]
puts 'Area: ' + con_string
when 'Ward:' && con_info.has? con_text[i+1]
puts 'Ward: ' + con_string
when 'Elected:' && con_info.has? con_text[i+1]
puts 'Elected: ' + con_string
when 'Party:' && con_info.has? con_text[i+1]
puts 'Party: ' + con_string
when 'Address:' && con_info.has? con_text[i+1]
puts 'Address: ' + con_string
when 'Email:' && con_info.has? con_text[i+1]
puts 'Email: ' + con_string
when 'Phone:' && con_info.has? con_text[i+1]
puts 'Phone: ' + con_string
when 'Mobile:' && con_info.has? con_text[i+1]
puts 'Mobile: ' + con_string
when 'Fax:' && con_info.has? con_text[i+1]
puts 'Fax: ' + con_string
else
puts "blank"
end
Expand Down

0 comments on commit b2ef66c

Please sign in to comment.