Another RSS to Mastodon bot.
Go to file
2019-12-24 18:53:00 +01:00
cmake Rewrite root CMake recipe. 2019-12-16 15:22:54 +01:00
man Read and parse config. 2019-12-24 18:53:00 +01:00
src Read and parse config. 2019-12-24 18:53:00 +01:00
.drone.yml Require mastodon-cpp-0.111.3. 2019-12-19 15:19:48 +01:00
.editorconfig Add EditorConfig. 2019-12-16 01:06:59 +01:00
.gitignore initial commit 2018-01-26 02:33:58 +01:00
CMakeLists.txt Rewrite root CMake recipe. 2019-12-16 15:22:54 +01:00
CODE_OF_CONDUCT.adoc Add Code Of Conduct. 2019-12-16 01:04:14 +01:00
CONTRIBUTING.adoc Add Code Of Conduct. 2019-12-16 01:04:14 +01:00
LICENSE initial commit 2018-01-26 02:33:58 +01:00
README.adoc Require mastodon-cpp-0.111.3. 2019-12-19 15:19:48 +01:00
watchwords.json more filtering 2018-02-01 12:03:16 +01:00

mastorss dumps RSS feeds into a mastodon account. Supports RSS 2.0 but not RSS 0.92. Does not support Atom at the moment.

Each <item> in feeds must have <link>, <title> and <description>.

Install

Dependencies

  • Tested OS: Linux

  • C++ compiler (tested: gcc 5 / 8)

  • cmake (tested: 3.14 / 3.9)

  • boost (tested: 1.71 / 1.62)

  • mastodon-cpp (at least: 0.111.3)

  • jsoncpp (tested: 1.9 / 1.7)

Get sourcecode

Development version

git clone https://schlomp.space/tastytea/mastorss.git

Compile

mkdir build
cd build/
cmake ..
cmake --build .

Install with make install.

Usage

Put watchwords.json into ${XDG_CONFIG_HOME}/mastorss/ [1]. Launch with profile name. The first occurence of every watchword in an RSS item will be turned into a hashtag. For profile-specific watchwords see the example in watchwords.json. In the first run only the newest entry is posted.

The profile cant be named "global".

Example session

% mastorss example

Example config file

${HOME}/.config/mastorss/config-example.json

    {
        "example": {
            "access_token": "123abc",
            "append": "#bot",
            "feedurl": "https:\/\/example.com\/feed.rss",
            "fixes":
            [
                "delete this",
                "<p>[Rr]ead more(\.{3}|…)</p>"
            ],
            "instance": "botsin.space",
            "interval" : 600,
            "max_size": 400,
            "skip":
            [
                "If the entry starts with this, skip it",
                "Skip me too!"
            ],
            "titles_as_cw" : false,
            "titles_only": false
        }
    }

Error codes

Same as mastodon-cpp, plus:

Code Explanation

1

Could not send post for unknown reasons.


1. ${XDG_CONFIG_HOME} is usually ~/.config/