class Import::FeedConfig

Overview

Configuration for a single feed

Defined in:

import.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_any(any, feed_name : String) : self #

Load from config (YAML::Any from config)


[View source]
def self.new(urls : Array(String), template : String, output_folder : String, format : String = "md", source_extension : Nil | String = nil, lang : String = "en", tags : String = "", skip_titles : Array(String) = [] of String, start_at : Nil | String = nil, fields : Hash(String, String) = {} of String => String, static : Hash(String, String) = {} of String => String, feed_format : Nil | String = nil, token : Nil | String = nil) #

[View source]

Instance Method Detail

def feed_format : String | Nil #

Feed format: "json" for JSON APIs, nil for RSS/Atom


[View source]
def feed_format=(feed_format : String | Nil) #

Feed format: "json" for JSON APIs, nil for RSS/Atom


[View source]
def fields : Hash(String, String) #

Field mappings: metadata_field -> source_field Example: {"title" => "title", "date" => "published", "content" => "body"}


[View source]
def fields=(fields : Hash(String, String)) #

Field mappings: metadata_field -> source_field Example: {"title" => "title", "date" => "published", "content" => "body"}


[View source]
def file_extension : String #

Get the actual file extension to use


[View source]
def format : String #

[View source]
def format=(format : String) #

[View source]
def json_feed? #

Check if this is a JSON/Pocketbase feed


[View source]
def lang : String #

[View source]
def lang=(lang : String) #

[View source]
def output_folder : String #

[View source]
def output_folder=(output_folder : String) #

[View source]
def skip_titles : Array(String) #

[View source]
def skip_titles=(skip_titles : Array(String)) #

[View source]
def source_extension : String | Nil #

[View source]
def source_extension=(source_extension : String | Nil) #

[View source]
def start_at : String | Nil #

[View source]
def start_at=(start_at : String | Nil) #

[View source]
def static : Hash(String, String) #

Static field values (applied to all items) Example: {"tags" => "blog, imported"}


[View source]
def static=(static : Hash(String, String)) #

Static field values (applied to all items) Example: {"tags" => "blog, imported"}


[View source]
def tags : String #

[View source]
def tags=(tags : String) #

[View source]
def template : String #

[View source]
def template=(template : String) #

[View source]
def token : String | Nil #

Authorization token for API requests


[View source]
def token=(token : String | Nil) #

Authorization token for API requests


[View source]
def urls : Array(String) #

[View source]
def urls=(urls : Array(String)) #

[View source]