Giter Club home page Giter Club logo

kirirss's Introduction

kirirss

Simple HTMLโ†’RSS converter. Can be easily integrated with cron, feed readers with external script support or other Ruby applications. Input data is specified with CSS selectors.

To make generating multiple feeds easier, the kirirss-batch.sh script can be used. It's in the misc directory.

Dependencies

chronic, nokogiri, and toml-rb gems need to be installed before using kirirss.

Config file

Sample configuration files can be found in the misc directory.

Fields prefixed with ๐Ÿ”ถ are required. "Skipped" means not present in the config file or empty. Note that even though some fields are not required, skipping them will produce invalid RSS feeds.

feed-title (string)

Content of the <title> feed tag. Page title is used if the field is skipped.

feed-description (string)

Content of the <description> feed tag. Empty if the field is skipped.

๐Ÿ”ถ feed-link (string)

URL of the page to extract data from. Used in of the <link> feed as well. Required.

๐Ÿ”ถ root-selector (string)

Root selector of a single input item. "Input item" is a tag which contains all data used in a single feed item. Required.

headers (table)

Additional headers to use when fetching the input page. Can be used for authentication or UA spoofing. Example:

[headers]
Cookie = "session_id=asdf42194"
X-Requested-With = "XMLHttpRequest"

tag.(name) (table)

Child tag of each <item> in the feed with the name (name). If this field is present, the <(name)> tag will exist in each item. Example tag:

[tag.pubDate]
selector = "time"
attribute = "datetime"
date-format = "auto"

selector (string)

Selector for the current tag contents. Not used if use-root is true.

use-root (boolean)

Use the tag matched by the root selector.

attribute (string)

Attribute of a matched input tag to be used for the current tag contents. When this field is present, content will be extracted from the specified attribute instead of the contents of the tag.

out-attributes (table)

Additional tag attributes. The most common use case:

[tag.guid]
# ...
out-attributes = {isPermaLink = false}

placeholder (string)

Text used when the input tag is empty or not found.

date-format (string)

strptime format of the date in the contents. If a special "auto" value is given, the date is parsed heuristically with chronic. Output tag will contain a RFC 2822-formatted date. Contents will not be date-formatted if this field is skipped.

is-url (boolean)

Make the URL absolute if it's relative.

kirirss's People

Contributors

tsudoko avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.