Skip to content

Commit

Permalink
Drop query string from reference PDF URLs
Browse files Browse the repository at this point in the history
This fixes #24
  • Loading branch information
webdev778 authored and ronaldtse committed Mar 19, 2022
1 parent 5ed8ce0 commit 71f5628
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exe/bipm-fetch-cgpm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ FileUtils.rm_rf "#{BASE_DIR}/cgpm/meetings-en"

binding.pry if date <= Date.parse("0000-01-01") || date >= Date.today

pdf = meeting.at_css('a.title-third[href*=".pdf"]')&.attr('href')
pdf = meeting.at_css('a.title-third[href*=".pdf"]')&.attr('href')&.split('?')&.first

h = {
"metadata" => {
Expand Down
2 changes: 1 addition & 1 deletion lib/bipm/data/importer/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def parse_resolution res, res_id, date, type = :cgpm, lang = 'en'
}

if refs.length > 0
r["reference"] = res.uri.merge(refs.first.attr('href')).to_s
r["reference"] = res.uri.merge(refs.first.attr('href')).to_s.split('?').first
name, page = refs.first.text.strip.split(/, p(?=[0-9])/)
r["reference_name"] = name
if page
Expand Down

0 comments on commit 71f5628

Please sign in to comment.