From c0c9511299f3634403eb2fa1c4248e30e9f1a54a Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 9 Feb 2023 02:41:18 -0300 Subject: [PATCH] rm libexec/quran-pull Remove leftover from The Great Rename --- libexec/quran-pull/quran.com | 31 ------------------------------ libexec/quran-pull/searchtruth.com | 28 --------------------------- 2 files changed, 59 deletions(-) delete mode 100755 libexec/quran-pull/quran.com delete mode 100755 libexec/quran-pull/searchtruth.com diff --git a/libexec/quran-pull/quran.com b/libexec/quran-pull/quran.com deleted file mode 100755 index 4e652db..0000000 --- a/libexec/quran-pull/quran.com +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby -lib_dir = File.realpath File.join(__dir__, "..", "..", "lib", "quran-pull") -require File.join(lib_dir, "pull") -require "optparse" -require "nokogiri" - -def grep(res) - html = Nokogiri::HTML(res.body) - el = html.css("div[class^='TranslationText']").last - el.text.gsub(/[0-9]/, "") -end - -## -# main -def main(argv) - cmd = Pull.new(Pull.cli(argv)) - cmd.keepalive do - 1.upto(114) do |surah_no| - rows = [] - 1.upto(cmd.count[surah_no]) do |ayah_no| - cmd.pull_ayah(surah_no, ayah_no) do |res| - rows.concat([ayah_no, grep(res)]) - end - cmd.line.rewind.print "Surah #{surah_no} [#{ayah_no}/#{cmd.count[surah_no]}]" - end - cmd.write(surah_no, rows) - cmd.line.end - end - end -end -main(ARGV) diff --git a/libexec/quran-pull/searchtruth.com b/libexec/quran-pull/searchtruth.com deleted file mode 100755 index 66de755..0000000 --- a/libexec/quran-pull/searchtruth.com +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env ruby -lib_dir = File.realpath File.join(__dir__, "..", "..", "lib", "quran-pull") -require File.join(lib_dir, "pull") -require "optparse" -require "nokogiri" - -def grep(res) - html = Nokogiri::HTML(res.body) - html.css("table[dir='rtl'] tr td div:last-child").map { _1.text.strip } -end - -## -# main -def main(argv) - cmd = Pull.new(Pull.cli(argv)) - cmd.keepalive do - 1.upto(114) do |surah_no| - rows = [] - cmd.pull_surah(surah_no) do |res| - rows.concat(grep(res).map.with_index(1) { [_2, _1] }) - end - cmd.line.rewind.print "Surah #{surah_no} [#{surah_no}/114]" - cmd.write(surah_no, rows) - end - cmd.line.end - end -end -main(ARGV)