Skip to content

Commit

Permalink
Fixup and add User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
mashedkeyboard committed May 5, 2023
1 parent 7fcbedc commit 13c4e67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# specified here will be installed and made available to your morph.io scraper.
# Find out more: https://morph.io/documentation/ruby

ruby '2.4.4'
ruby '2.5.3'

source 'https://rubygems.org'
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ DEPENDENCIES
wikidata-fetcher (>= 0.20.0)!

RUBY VERSION
ruby 2.4.4p296
ruby 2.5.3p105

BUNDLED WITH
1.16.5
1.16.6
3 changes: 2 additions & 1 deletion scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class Membership < Scraped::JSON
SPARQL

url = WIKIDATA_SPARQL_URL % CGI.escape(memberships_query)
data = Results.new(response: Scraped::Request.new(url: url).response).memberships
data = Results.new(response: Scraped::Request.new(url: url,
headers: { "User-Agent" => "welsh-assembly-p39s morph scraper - curtis [at] loudspeek [dot] cc" }).response).memberships
puts data.map(&:compact).map(&:sort).map(&:to_h) if ENV['MORPH_DEBUG']

ScraperWiki.sqliteexecute('DROP TABLE data') rescue nil
Expand Down

0 comments on commit 13c4e67

Please sign in to comment.