💾 Archived View for bbs.geminispace.org › u › oldernow › 12778 captured on 2023-12-28 at 15:59:55. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Hello USENET, well hello USENET

It's so nice to see me back where I belonged!

Well, we'll see. A bit of browsing about the "place" revealed a pretty weak ratio of spamiliciousness to legitimate interaction (you know, via inline quoting). So I gots to cross the phalanges and hope there might be a few decent people up for textual fun in the several newsgroups where I can imagine participating.

Looks like the locale we moved from received more snowfall overnight than I'm ready to get with, so sighs of relief.

I threw a little "get me some (KJV) bible verses" script together because, well, for the love of scraping... but also because sometimes people post just the book/chapter/verse without quoting, and a solution that can blast verses right into on open vim session beats the bleep out of copy/pasting from the flippin' browser:

#! /usr/bin/env lua
if arg[2] then
  local book = arg[1]
  local chapter,verses = string.match(arg[2], '^(%d+):(.*)


)
  local url = nil
  local verse1 = nil
  local verse2 = nil
  if string.match(verses, '-') then
    verse1,verse2 = string.match(verses, '(%d+)-(%d+)')
    url = 'https://www.kingjamesbibleonline.org/' .. book .. '-' .. chapter .. '-' .. verse1 .. '_' .. chapter .. '-' .. verse2 .. '/'
  else
    url = 'https://www.kingjamesbibleonline.org/' .. book .. '-' .. chapter .. '-' .. verses .. '/'
  end
  local command = "curl -s -L -o- '" .. url .. "'"
  local handle = io.popen(command)
  if handle then
    print('=== ' .. arg[1] .. ' ' .. arg[2])
    verse1 = tonumber(verse1)
    for line in handle:lines() do
      for verse in string.gmatch(line, '<a href=".- title="CLICK FOR MORE TRANSLATIONS .->(.-)</a>') do
        local verse = string.gsub(verse, '<.->', '')
        print(verse1 .. ' ' .. verse)
        verse1 = verse1 + 1
      end
    end
    handle:close()
  else
    print('=== something went wrong with popen for url(' .. url .. ')')
  end
else
  print('Usage: bible <book> <chapter:verse[-verse]>')
end

https://www.kingjamesbibleonline.org/'

https://www.kingjamesbibleonline.org/'

☯️ oldernow

Dec 18 · 10 days ago