Class: OwaspRiScraper::EventParser
- Inherits:
-
Object
- Object
- OwaspRiScraper::EventParser
- Defined in:
- lib/owasp_ri_scraper/event_parser.rb
Instance Method Summary collapse
-
#parse(content) ⇒ Object
This method is extremely fragile, but so far OWASP.org has been sticking to the same format, so that may be okay.
Instance Method Details
#parse(content) ⇒ Object
This method is extremely fragile, but so far OWASP.org has been sticking to the same format, so that may be okay.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/owasp_ri_scraper/event_parser.rb', line 10 def parse(content) doc = Nokogiri::HTML.parse(content) event_node = doc.css('div#mw-content-text pre').first start_time = event_node.css('b').text description = event_node.children.select(&:text?).map(&:text).join("\n").strip Event.new( Time.parse(start_time), nil, description ) end |