Skip to content

Commit b70e78a

Browse files
committed
Merge branch 'fix-deprecations'
2 parents 503a14d + fc47088 commit b70e78a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/nom/nom.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ def search args
106106
term = args.join(" ")
107107
puts
108108
term = term.encode("ISO-8859-1")
109-
url = "https://fddb.info/db/de/suche/?udd=0&cat=site-de&search=#{URI.escape(term)}"
109+
url = "https://fddb.info/db/de/suche/?udd=0&cat=site-de&search=#{CGI.escape(term)}"
110110

111-
page = Nokogiri::HTML(open(url))
111+
page = Nokogiri::HTML(URI.open(url))
112112
results = page.css(".standardcontent a").map{|a| a["href"]}.select{|href| href.include? "lebensmittel"}
113113

114114
results[0..4].each do |result|
115-
page = Nokogiri::HTML(open(result))
115+
page = Nokogiri::HTML(URI.open(result))
116116
title = page.css(".breadcrumb a").last.text
117117
brand = page.css(".standardcontent p a").select{|a| a["href"].include? "hersteller"}.first.text
118118
puts "#{title} (#{brand})"

0 commit comments

Comments
 (0)