Class: Basilisk::SeoProcessor
- Inherits:
-
CSVProcessor
- Object
- Processor
- CSVProcessor
- Basilisk::SeoProcessor
- Defined in:
- lib/basilisk/processors/seo_processor.rb
Overview
Write a csv containing important seo fields: title, h1, h2, description, and keywords.
Constant Summary collapse
- HTMLTags =
['title', 'h1', 'h2']
- MetaTags =
['description', 'keywords']
Instance Method Summary collapse
-
#initialize(search_name) ⇒ SeoProcessor
constructor
A new instance of SeoProcessor.
- #process_page(page, page_hash) ⇒ Object
Methods inherited from CSVProcessor
Methods inherited from Processor
Constructor Details
#initialize(search_name) ⇒ SeoProcessor
7 8 9 10 |
# File 'lib/basilisk/processors/seo_processor.rb', line 7 def initialize(search_name) super save_header_row end |
Instance Method Details
#process_page(page, page_hash) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/basilisk/processors/seo_processor.rb', line 12 def process_page(page, page_hash) = Hash.new("") HTMLTags.each { |tag_name| check_html_element(tag_name, page.doc) } MetaTags.each { || (, page.doc) } save_tag_row(page) end |