Module: Html2rss
- Defined in:
- lib/html2rss.rb,
lib/html2rss/cli.rb,
lib/html2rss/url.rb,
lib/html2rss/error.rb,
lib/html2rss/config.rb,
lib/html2rss/version.rb,
lib/html2rss/rendering.rb,
lib/html2rss/selectors.rb,
lib/html2rss/auto_source.rb,
lib/html2rss/rss_builder.rb,
lib/html2rss/config/schema.rb,
lib/html2rss/html_extractor.rb,
lib/html2rss/html_navigator.rb,
lib/html2rss/blocked_surface.rb,
lib/html2rss/request_service.rb,
lib/html2rss/request_session.rb,
lib/html2rss/config/validator.rb,
lib/html2rss/request_controls.rb,
lib/html2rss/selectors/config.rb,
lib/html2rss/json_feed_builder.rb,
lib/html2rss/category_extractor.rb,
lib/html2rss/auto_source/cleanup.rb,
lib/html2rss/auto_source/scraper.rb,
lib/html2rss/rss_builder/article.rb,
lib/html2rss/rss_builder/channel.rb,
lib/html2rss/config/class_methods.rb,
lib/html2rss/selectors/extractors.rb,
lib/html2rss/articles/deduplicator.rb,
lib/html2rss/config/dynamic_params.rb,
lib/html2rss/rss_builder/enclosure.rb,
lib/html2rss/config/request_headers.rb,
lib/html2rss/json_feed_builder/item.rb,
lib/html2rss/rendering/pdf_renderer.rb,
lib/html2rss/request_service/budget.rb,
lib/html2rss/request_service/policy.rb,
lib/html2rss/rss_builder/stylesheet.rb,
lib/html2rss/request_service/context.rb,
lib/html2rss/auto_source/scraper/html.rb,
lib/html2rss/rendering/audio_renderer.rb,
lib/html2rss/rendering/image_renderer.rb,
lib/html2rss/rendering/media_renderer.rb,
lib/html2rss/rendering/video_renderer.rb,
lib/html2rss/request_service/response.rb,
lib/html2rss/request_service/strategy.rb,
lib/html2rss/selectors/extractors/href.rb,
lib/html2rss/selectors/extractors/html.rb,
lib/html2rss/selectors/extractors/text.rb,
lib/html2rss/selectors/post_processors.rb,
lib/html2rss/auto_source/scraper/schema.rb,
lib/html2rss/selectors/extractors/static.rb,
lib/html2rss/config/multiple_feeds_config.rb,
lib/html2rss/auto_source/scraper/microdata.rb,
lib/html2rss/html_extractor/date_extractor.rb,
lib/html2rss/rendering/description_builder.rb,
lib/html2rss/request_session/runtime_input.rb,
lib/html2rss/auto_source/scraper/json_state.rb,
lib/html2rss/html_extractor/image_extractor.rb,
lib/html2rss/request_service/response_guard.rb,
lib/html2rss/request_session/rel_next_pager.rb,
lib/html2rss/request_session/runtime_policy.rb,
lib/html2rss/selectors/extractors/attribute.rb,
lib/html2rss/selectors/post_processors/base.rb,
lib/html2rss/selectors/post_processors/gsub.rb,
lib/html2rss/auto_source/scraper/schema/thing.rb,
lib/html2rss/request_service/faraday_strategy.rb,
lib/html2rss/request_service/puppet_commander.rb,
lib/html2rss/auto_source/scraper/semantic_html.rb,
lib/html2rss/auto_source/scraper/wordpress_api.rb,
lib/html2rss/selectors/object_to_xml_converter.rb,
lib/html2rss/html_extractor/enclosure_extractor.rb,
lib/html2rss/selectors/post_processors/template.rb,
lib/html2rss/selectors/post_processors/parse_uri.rb,
lib/html2rss/selectors/post_processors/substring.rb,
lib/html2rss/auto_source/scraper/schema/item_list.rb,
lib/html2rss/auto_source/scraper/schema/list_item.rb,
lib/html2rss/request_service/browserless_strategy.rb,
lib/html2rss/selectors/post_processors/parse_time.rb,
lib/html2rss/selectors/post_processors/sanitize_html.rb,
lib/html2rss/selectors/post_processors/html_to_markdown.rb,
lib/html2rss/selectors/post_processors/markdown_to_html.rb,
lib/html2rss/auto_source/scraper/wordpress_api/page_scope.rb,
lib/html2rss/auto_source/scraper/schema/category_extractor.rb,
lib/html2rss/auto_source/scraper/wordpress_api/posts_endpoint.rb,
lib/html2rss/auto_source/scraper/semantic_html/anchor_selector.rb,
lib/html2rss/selectors/post_processors/html_transformers/wrap_img_in_a.rb,
lib/html2rss/selectors/post_processors/html_transformers/transform_urls_to_absolute_ones.rb
Overview
The Html2rss namespace.
Defined Under Namespace
Modules: Articles, BlockedSurface, Rendering Classes: AutoSource, CLI, CategoryExtractor, Config, Error, HtmlExtractor, HtmlNavigator, JsonFeedBuilder, RequestControls, RequestService, RequestSession, RssBuilder, Selectors, Url
Constant Summary collapse
- Log =
The logger instance.
Logger.new($stdout)
- VERSION =
'0.18.0'
Class Method Summary collapse
-
.auto_json_feed(url, strategy: :faraday, items_selector: nil, max_redirects: nil, max_requests: nil) ⇒ Hash
Scrapes the provided URL and returns a JSONFeed 1.1 hash.
-
.auto_source(url, strategy: :faraday, items_selector: nil, max_redirects: nil, max_requests: nil) ⇒ RSS::Rss
Scrapes the provided URL and returns an RSS object.
-
.config_from_yaml_file(file, feed_name = nil) ⇒ Hash<Symbol, Object>
Loads a feed configuration from YAML.
-
.feed(raw_config) ⇒ RSS::Rss
Returns an RSS object generated from the provided configuration.
-
.json_feed(raw_config) ⇒ Hash
Returns a JSONFeed 1.1 hash generated from the provided configuration.
Class Method Details
.auto_json_feed(url, strategy: :faraday, items_selector: nil, max_redirects: nil, max_requests: nil) ⇒ Hash
Scrapes the provided URL and returns a JSONFeed 1.1 hash.
78 79 80 |
# File 'lib/html2rss.rb', line 78 def self.auto_json_feed(url, strategy: :faraday, items_selector: nil, max_redirects: nil, max_requests: nil) json_feed(build_auto_source_config(url:, strategy:, items_selector:, max_redirects:, max_requests:)) end |
.auto_source(url, strategy: :faraday, items_selector: nil, max_redirects: nil, max_requests: nil) ⇒ RSS::Rss
Scrapes the provided URL and returns an RSS object.
65 66 67 |
# File 'lib/html2rss.rb', line 65 def self.auto_source(url, strategy: :faraday, items_selector: nil, max_redirects: nil, max_requests: nil) feed(build_auto_source_config(url:, strategy:, items_selector:, max_redirects:, max_requests:)) end |
.config_from_yaml_file(file, feed_name = nil) ⇒ Hash<Symbol, Object>
Loads a feed configuration from YAML.
30 31 32 |
# File 'lib/html2rss.rb', line 30 def self.config_from_yaml_file(file, feed_name = nil) Config.load_yaml(file, feed_name) end |
.feed(raw_config) ⇒ RSS::Rss
Returns an RSS object generated from the provided configuration.
39 40 41 42 43 |
# File 'lib/html2rss.rb', line 39 def self.feed(raw_config) run_pipeline(raw_config) do |response:, config:, articles:| build_rss_feed(response:, config:, articles:) end end |
.json_feed(raw_config) ⇒ Hash
Returns a JSONFeed 1.1 hash generated from the provided configuration.
50 51 52 53 54 |
# File 'lib/html2rss.rb', line 50 def self.json_feed(raw_config) run_pipeline(raw_config) do |response:, config:, articles:| build_json_feed(response:, config:, articles:) end end |