module NewsScraper
Constants
- VERSION
Attributes
configuration[W]
Public Instance Methods
configuration()
click to toggle source
:nocov:
# File lib/news_scraper.rb, line 47 def configuration @configuration ||= Configuration.new end
configure() { |configuration| ... }
click to toggle source
# File lib/news_scraper.rb, line 55 def configure yield(configuration) end
reset_configuration()
click to toggle source
# File lib/news_scraper.rb, line 51 def reset_configuration @configuration = Configuration.new end
train(query:)
click to toggle source
NewsScraper::train
is an interactive command-line prompt that:
-
Collates all articles for the given :query
-
Grep for
:data_types
using:presets
in the config set in theconfiguration
-
Displays the results of each
:preset
grep for a given:data_type
-
Prompts to select one of the
:presets
or define a pattern for that domain's:data_type
N.B: User may ignore all presets and manually configure it in the YAML file
-
Saves the selected
:preset
toconfig/article_scrape_patterns.yml
Params
-
query
: a keyword arugment specifying the query to train on
:nocov:
# File lib/news_scraper.rb, line 42 def train(query:) Trainer.train(query: query) end