Sha256: 10fd502d276f09acc21e3fb4f06897d2fe873cc6765faaac18e62e073f5e2e85
Contents?: true
Size: 547 Bytes
Versions: 4
Compression:
Stored size: 547 Bytes
Contents
# frozen_string_literal: true module WordOfTheDay class Adapter class MerriamWebster < Base private def word html.match(/<h2 class="word-header-txt">(.+?)</)&.captures&.first end def url "https://www.merriam-webster.com/word-of-the-day/#{today}" end private def today Time.now.strftime('%F') end def html case (response = HTTPX.get(url)) in { status: 200 } then response.body.to_s else '' end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems