pull-english: small tweaks.

This commit is contained in:
0x1eef 2022-07-14 22:02:29 -03:00
parent 8c283e23ee
commit 43939c669b

View file

@ -42,21 +42,19 @@ http = Net::HTTP.new(base_uri, 443)
http.use_ssl = true http.use_ssl = true
1.upto(114) do |chapter| 1.upto(114) do |chapter|
path = format(dest, chapter:)
rows = [] rows = []
vcount = vmap[chapter.to_s] vcount = vmap[chapter.to_s]
1.upto(vcount) do |verse| 1.upto(vcount) do |verse|
line.rewind.print "Download: #{verse}/#{vcount}" line.rewind.print("Download: #{verse}/#{vcount}")
res = http.request_get("/#{chapter}/#{verse}") res = http.request_get("/#{chapter}/#{verse}")
if Net::HTTPOK === res if Net::HTTPOK === res
rows.push([verse, find_content.(res)]) rows.push([verse, find_content.(res)])
else else
print "\n", Paint["Error: ", :red, :bold], res.class, "\n" line.end.print(Paint["Error: ", :red, :bold], res.class).end
exit(1) exit(1)
end end
sleep delay sleep delay
end end
File.write(path, JSON.pretty_generate(rows)) File.write(format(dest, chapter:), JSON.pretty_generate(rows))
print "\n", Paint["OK: ", :green, :bold], path, "\n" line.end.print(Paint["OK", :green, :bold]).end
end end