Skip to content

Commit

Permalink
Store the Term information in one shot
Browse files Browse the repository at this point in the history
This will let us fix a bug more easily in the next commit.
  • Loading branch information
tmtmtmtm committed Nov 28, 2016
1 parent 1651f26 commit 99ade5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper.rb
Expand Up @@ -98,12 +98,12 @@ def scrape_person(id, icon)
scrape_letter(let)
end

@TERMS.sort_by { |t, _| t.to_i }.each do |t, ds|
term = {
term_data = @TERMS.sort_by { |t, _| t.to_i }.map do |t, ds|
{
id: t,
name: "Knesset #{t}",
start_date: ds.map(&:first).compact.min,
end_date: ds.map(&:last).compact.max,
}
ScraperWiki.save_sqlite([:id], term, 'terms')
end
ScraperWiki.save_sqlite([:id], term_data, 'terms')

0 comments on commit 99ade5a

Please sign in to comment.