Skip to content

Commit

Permalink
Historic terms
Browse files Browse the repository at this point in the history
  • Loading branch information
tmtmtmtm committed Feb 6, 2016
1 parent 70c6e6c commit 5b6d130
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions scraper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
require 'wikidata/fetcher'
require 'pry'

names = EveryPolitician::Wikidata.wikipedia_xpath(
names = {}

names[6] = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://en.wikipedia.org/wiki/List_of_Members_of_the_6th_National_Assembly_of_Namibia',
before: '//h2/span[@id="References"]',
xpath: '//li//a[not(@class="new")]/@title',
)

EveryPolitician::Wikidata.scrape_wikidata(names: { en: names })
names[5] = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://en.wikipedia.org/wiki/List_of_Members_of_the_5th_National_Assembly_of_Namibia',
before: '//h2/span[@id="References"]',
xpath: '//li//a[not(@class="new")]/@title',
)

names[4] = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://en.wikipedia.org/wiki/List_of_Members_of_the_4th_National_Assembly_of_Namibia',
before: '//h2/span[@id="References"]',
xpath: '//li//a[not(@class="new")]/@title',
)

names[2] = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://en.wikipedia.org/wiki/Members_of_the_2nd_National_Assembly_of_Namibia',
before: '//h2/span[@id="References"]',
xpath: '//li//a[not(@class="new")]/@title',
)

names[1] = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://en.wikipedia.org/wiki/Members_of_the_1st_National_Assembly_of_Namibia',
before: '//h2/span[@id="References"]',
xpath: '//li//a[not(@class="new")]/@title',
)

EveryPolitician::Wikidata.scrape_wikidata(names: { en: names.values.flatten.uniq })
warn EveryPolitician::Wikidata.notify_rebuilder

0 comments on commit 5b6d130

Please sign in to comment.