Create default.rb

This commit is contained in:
王戈wg
2021-07-27 10:03:16 +08:00
committed by GitHub
parent 001d33c0b7
commit 40682b1dc3

17
websites/default.rb Normal file
View File

@@ -0,0 +1,17 @@
register_website(
name: 'default',
test: -> (uri) {
false
},
process: -> (html) {
document = Nokogiri::HTML(html)
article = document.css('article').first || document.css('main').first
title = document.css('title').first.content
{
title: title,
author: nil,
content: article.to_html.lines.map(&:strip).join
}
}
)