Module: NewsFetcher

Defined in:
lib/newsfetcher.rb,
lib/newsfetcher.rb,
lib/newsfetcher/item.rb,
lib/newsfetcher/error.rb,
lib/newsfetcher/command.rb,
lib/newsfetcher/fetcher.rb,
lib/newsfetcher/history.rb,
lib/newsfetcher/profile.rb,
lib/newsfetcher/scrubber.rb,
lib/newsfetcher/commands/add.rb,
lib/newsfetcher/commands/dir.rb,
lib/newsfetcher/commands/fix.rb,
lib/newsfetcher/commands/get.rb,
lib/newsfetcher/subscription.rb,
lib/newsfetcher/commands/edit.rb,
lib/newsfetcher/commands/init.rb,
lib/newsfetcher/commands/show.rb,
lib/newsfetcher/commands/reset.rb,
lib/newsfetcher/commands/enable.rb,
lib/newsfetcher/commands/remove.rb,
lib/newsfetcher/commands/update.rb,
lib/newsfetcher/commands/disable.rb,
lib/newsfetcher/commands/discover.rb

Defined Under Namespace

Modules: Commands, Scrubber Classes: Command, Error, Fetcher, History, Item, Profile, Subscription

Constant Summary collapse

ConfigFileName =
'config.json'
ItemHistoryFileName =
'item_history.jsonl'
ResponseHistoryFileName =
'response_history.jsonl'
DefaultProfileDir =
'~/.newsfetcher'
SubscriptionsDirName =
'subscriptions'
FeedTypes =
%w[
  application/atom+xml
  application/rss+xml
  application/rdf+xml
  text/atom+xml
  text/rss+xml
  text/rdf+xml
  application/xml
  text/xml
]
DaySecs =
24 * 60 * 60
BaseConfig =
Simple::Configurator.define(
  max_threads: 100,
  log_level: { default: :warn, converter: proc { |o| o.downcase.to_sym } },
  max_age: 30 * DaySecs,
  main_stylesheet: File.join(File.dirname(__FILE__), '../message/stylesheet.css'),
  aux_stylesheets: nil,
  delivery_method: { converter: :to_sym },
  delivery_params: { default: {} },
  mail_from: nil,
  mail_to: nil,
  mail_subject: '[<%= subscription_id %>] <%= item_title %>',
  uri: proc { |o| Addressable::URI.parse(o) },
  title: nil,
  disabled: false,
  update_interval: 60 * 60,
  ignore_uris: { default: [], converter: proc { |o| [o].flatten.compact.map { |r| Regexp.new(r) } } },
  ignore_moved: false,
  root_folder: nil,
  consolidate: false,
)