Skip to content

Commit

Permalink
Remove other methods of finding members
Browse files Browse the repository at this point in the history
These are all subsets of the Wikidata members, other than including some
people who we don't want (e.g. people who have only been MEPs, or who
were members of earlier incarnations of the Assembly)
  • Loading branch information
tmtmtmtm committed Feb 6, 2019
1 parent 78dc56d commit d3462c4
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions scraper.rb
Expand Up @@ -3,15 +3,6 @@

require 'wikidata/fetcher'

names = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://pt.wikipedia.org/wiki/Lista_de_deputados_de_Portugal',
after: '//span[@id="A"]',
xpath: '//table//td[1]//a[not(@class="new")]/@title',
)

by_category_pt = WikiData::Category.new( 'Categoria:Deputados da Assembleia da República Portuguesa', 'pt').member_titles
by_category_de = WikiData::Category.new( 'Kategorie:Mitglied der Assembleia da República', 'de').member_titles

# Find all P39s of the Legislature
query = <<EOS
SELECT DISTINCT ?item WHERE {
Expand All @@ -25,4 +16,4 @@
idquery = 'SELECT DISTINCT ?item WHERE { ?item wdt:P6199 [] }'
ppids = EveryPolitician::Wikidata.sparql(idquery)

EveryPolitician::Wikidata.scrape_wikidata(ids: p39s | idquery, names: { pt: names | by_category_pt, de: by_category_de })
EveryPolitician::Wikidata.scrape_wikidata(ids: p39s | idquery)

0 comments on commit d3462c4

Please sign in to comment.