* [[[FIPS199,NISTIR 8228]]], Federal Information Processing Standard 199, _Standards for Security Categorization of Federal Information and Information System_, February 2004. https://doi.org/10.6028/NIST.FIPS.199[https://doi.org/10.6028/NIST.FIPS.199].
In scrapper.rb:
def fetch_link(doc)
links = []
if doc.is_a? Hash
links << { type: "uri", content: doc["uri"] } if doc["uri"]
doi = "https://doi.org/" + doc["doi"] if doc["doi"]
else
pub = doc.at "//p/strong[.='Publication:']"
pdf = pub.at "./following-sibling::a[.=' Local Download']"
doi = pub.at("./following-sibling::a[contains(.,'(DOI)')]")&.attr :href
links << { type: "pdf", content: pdf[:href] } if pdf
end
links << { type: "doi", content: doi } if doi
links
end
In scrapper.rb:
Crashes because pub is nil.