From 43939c669bbbaf962ad84feb44f1b53ec029425c Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 14 Jul 2022 22:02:29 -0300 Subject: [PATCH] pull-english: small tweaks. --- bin/json/pull-english | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/json/pull-english b/bin/json/pull-english index 3ff6e1a..d38c9a7 100755 --- a/bin/json/pull-english +++ b/bin/json/pull-english @@ -42,21 +42,19 @@ http = Net::HTTP.new(base_uri, 443) http.use_ssl = true 1.upto(114) do |chapter| - path = format(dest, chapter:) rows = [] vcount = vmap[chapter.to_s] - 1.upto(vcount) do |verse| - line.rewind.print "Download: #{verse}/#{vcount}" + line.rewind.print("Download: #{verse}/#{vcount}") res = http.request_get("/#{chapter}/#{verse}") if Net::HTTPOK === res rows.push([verse, find_content.(res)]) else - print "\n", Paint["Error: ", :red, :bold], res.class, "\n" + line.end.print(Paint["Error: ", :red, :bold], res.class).end exit(1) end sleep delay end - File.write(path, JSON.pretty_generate(rows)) - print "\n", Paint["OK: ", :green, :bold], path, "\n" + File.write(format(dest, chapter:), JSON.pretty_generate(rows)) + line.end.print(Paint["OK", :green, :bold]).end end