muse-dl/src/infoparser.cr

23 lines
489 B
Crystal
Raw Normal View History

2020-03-28 20:02:55 +00:00
require "myhtml"
module Muse::Dl
class InfoParser
2020-03-28 20:14:43 +00:00
def self.infobox(myhtml : Myhtml::Parser)
2020-03-28 20:02:55 +00:00
info = Hash(String, String).new
myhtml.css(".details_row").each do |row|
label = row.css(".cell").map(&.inner_text).to_a[0].strip
value = row.css(".cell").map(&.inner_text).to_a[1].strip
case label
when "MARC Record"
else
info[label] = value
end
end
return info
end
2020-03-28 20:14:43 +00:00
def self.title
end
2020-03-28 20:02:55 +00:00
end
end