Browse Source

Bugfix: prefix baseurl to images url

master
Adrian Short 7 years ago
parent
commit
2715d297cc
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      scraper.rb

+ 1
- 2
scraper.rb View File

@@ -20,12 +20,11 @@ def parse(app)
matches = record['title'].match(/(\d+\/\d+\/\w+)\s+-\s+(.+)/) matches = record['title'].match(/(\d+\/\d+\/\w+)\s+-\s+(.+)/)
record['council_reference'] = matches[1] record['council_reference'] = matches[1]
record['type'] = matches[2] record['type'] = matches[2]
# puts record['council_reference']


app.search("a").each do |link| app.search("a").each do |link|
record['info_url'] = BASEURL + link['href'].strip if link['href'].match(/Details/) record['info_url'] = BASEURL + link['href'].strip if link['href'].match(/Details/)
record['map_url'] = link['href'].strip if link['href'].match(/\?map=/) record['map_url'] = link['href'].strip if link['href'].match(/\?map=/)
record['images_url'] = link['href'].strip if link['href'].match(/ImageMenu/)
record['images_url'] = BASEURL + link['href'].strip if link['href'].match(/ImageMenu/)
record['comment_url'] = BASEURL + link['href'].strip if link['href'].match(/PlanningComments/) record['comment_url'] = BASEURL + link['href'].strip if link['href'].match(/PlanningComments/)
end end




Loading…
Cancel
Save