summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2024-06-04 09:02:09 +0200
committerGuillermo Ramos2024-06-04 09:02:09 +0200
commita42c06f6108da26c1645190352252780b6655042 (patch)
treec3f365ff43e23c139ca47ea0a8234ed3831b4a8b
parent9035dd0feeee4815d1459cab399d021c9c500614 (diff)
downloadbots-a42c06f6108da26c1645190352252780b6655042.tar.gz
aesan: fixes
-rwxr-xr-xaesan_alerts.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/aesan_alerts.rb b/aesan_alerts.rb
index b909ee7..675c047 100755
--- a/aesan_alerts.rb
+++ b/aesan_alerts.rb
@@ -33,7 +33,7 @@ def fetch_first_paragraph(url)
ps = document.xpath('//section[@class="theContent"]/p/a').filter_map do |p|
title = p.text.gsub(/^\s+|\s+$/, '')
- "* #{title} - #{AESAN_HOST}/#{p['href']}" if read_title(READ_TITLES_FILE, title)
+ "* #{title} - #{AESAN_HOST}#{p['href']}" if read_title(READ_TITLES_FILE, title)
end
if ps.any?
@@ -43,11 +43,9 @@ def fetch_first_paragraph(url)
puts "Se han publicado una o más alertas alimentarias en AESAN:\n"
end
puts ps
- else
- warn "No se encontró ningún resultado"
end
else
- warn "Error al acceder a la página: #{response.code} #{response.message}"
+ warn "Error al descargar página: #{response.code} #{response.message}"
end
end