mastorss/README.adoc

111 lines
3.2 KiB
Plaintext
Raw Normal View History

2019-12-16 01:00:59 +01:00
:toc: preamble
:project: mastorss
:uri-base: https://schlomp.space/tastytea/{project}
2019-12-16 00:58:12 +01:00
:uri-gcc: https://gcc.gnu.org/
:uri-cmake: https://cmake.org/
:uri-asciidoc: http://asciidoc.org/
:uri-catch: https://github.com/catchorg/Catch2
:uri-boost: https://www.boost.org/
:uri-mastodon-cpp: https://schlomp.space/tastytea/mastodon-cpp
:uri-jsoncpp: https://github.com/open-source-parsers/jsoncpp
2019-12-24 23:24:24 +01:00
*mastorss* reads RSS feeds and posts the items via the Mastodon API. Does not
support Atom at the moment.
2019-12-16 00:58:12 +01:00
Each `<item>` in feeds must have `<link>`, `<title>` and `<description>`.
== Install
=== Dependencies
* Tested OS: Linux
2019-12-25 02:08:16 +01:00
* C++ compiler (tested: link:{uri-gcc}[gcc] 9)
* link:{uri-cmake}[cmake] (at least: 3.9)
* link:{uri-boost}[boost] (at least: 1.62)
2019-12-19 15:19:48 +01:00
* link:{uri-mastodon-cpp}[mastodon-cpp] (at least: 0.111.3)
2019-12-25 02:08:16 +01:00
* link:{uri-jsoncpp}[jsoncpp] (at least: 1.7)
2019-12-16 00:58:12 +01:00
=== Get sourcecode
==== Development version
[source,shell]
--------------------------------------------------------------------------------
git clone https://schlomp.space/tastytea/mastorss.git
--------------------------------------------------------------------------------
=== Compile
[source,shell]
--------------------------------------------------------------------------------
mkdir build
cd build/
cmake ..
cmake --build .
--------------------------------------------------------------------------------
Install with `make install`.
== Usage
Put `watchwords.json` into `${XDG_CONFIG_HOME}/mastorss/`
footnote:[`${XDG_CONFIG_HOME}` is usually `~/.config/`]. Launch with profile
2019-12-25 02:08:16 +01:00
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.
2019-12-16 00:58:12 +01:00
The profile can't be named "global".
=== Example session
[source,shellsession]
--------------------------------------------------------------------------------
% mastorss example
--------------------------------------------------------------------------------
=== Example config file
${HOME}/.config/mastorss/config-example.json
[source,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
link:{uri-mastodon-cpp}/src/branch/master/README.adoc#_error_codes[mastodon-cpp],
plus:
[%autowidth,cols=">,<"]
|===========================================================
| Code | Explanation
2019-12-16 15:23:06 +01:00
| 1 | Could not send post for unknown reasons.
2019-12-16 00:58:12 +01:00
|===========================================================
2019-12-16 01:00:59 +01:00
include::{uri-base}/raw/branch/main/CONTRIBUTING.adoc[]