Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
save data to db
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Apr 4, 2014
1 parent cd108f9 commit d6a4c46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scraper.rb
Expand Up @@ -17,7 +17,12 @@ def scrape_page(page, url)
"description" => tr.search("td")[2].inner_text,
"address" => tr.search("td")[3].inner_text
}
p record
#p record
if (ScraperWiki.select("* from data where `council_reference`='#{record['council_reference']}'").empty? rescue true)
ScraperWiki.save_sqlite(['council_reference'], record)
else
puts "Skipping already saved record " + record['council_reference']
end
end
end

Expand Down

0 comments on commit d6a4c46

Please sign in to comment.