Simplify README

This commit is contained in:
Marian Steinbach 2019-11-19 14:08:48 +01:00
parent a7e2d4f63b
commit 1768ed9965

View file

@ -1,46 +1,26 @@
### description # mastodon-bot
the bot will post the timeline from the specified Twitter/Tumblr accounts and RSS feeds to Mastodon Diese Bot-Software von Dmitri Sotnikov erlaubt das Cross-Posten von Beiträgen aus einem Twitter Feed oder einem RSS Feed auf Mastodon.
### installation Original: https://github.com/yogthos/mastodon-bot
1. install [Node.js](https://nodejs.org/en/) In diesem Repository bieten wir eine angepasste Version mit vereinfachter Dokumentation und Konfiguration.
2. run `npm install` to install Node modules
3. run `npm start` to, well, start
If you wish to run the script directly, you will need to have [Lumo](https://github.com/anmonteiro/lumo) available on the shell path. Lumo can be installed globally via NPM by running: #### Ausführung
npm install -g lumo-cljs Mit Docker und der Konfigurationsdatei `my_config.edn` im aktuellen Verzeichnis kann der Bot so ausgeführt werden:
If you get a [permission failure](https://github.com/anmonteiro/lumo/issues/206), try this:
npm install -g lumo-cljs --unsafe-perm
### usage
#### Docker synopsis
docker run --rm -ti \ docker run --rm -ti \
-v $(pwd):/config \ -v $(pwd):/config \
--env MASTODON_BOT_CONFIG=/config/my_config.edn \ --env MASTODON_BOT_CONFIG=/config/my_config.edn \
quay.io/netzbegruenung/mastodon-bot quay.io/netzbegruenung/mastodon-bot
#### long form #### Vorbereitung und Konfiguration
* create a Mastodon API key following the instructions [here](https://tinysubversions.com/notes/mastodon-bot/) - Erstelle einen Mastodon API key wie [hier](https://tinysubversions.com/notes/mastodon-bot/) beschrieben. Geht dazu auf https://gruene.social/settings/applications und ersttellt einen Key mit der Berechtigung `read:statuses` und `write:statuses`.
* create a Twitter API key follwing the instructions [here](https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens) * Erzeuge einen Twitter Developer account und eine App wie [hier](https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens) beschrieben.
* create a Tumblr API key following the instructions [here](http://www.developerdrive.com/2014/05/how-to-get-started-with-the-tumblr-api-part-1/) * Kopiere `config.edn.example` und trage alle API keys und weitere Daten ein, wie darin beschrieben.
* create a config file by copying the `config.edn.example`
**NOTE**: the bot checks the specified Mastodon account to see the timestamp of the last post, and only posts content
with later timestamps to avoid duplicate posts. On the first run the timestamp will default to current time.
* the bot looks for `config.edn` at its relative path by default, an alternative location can be specified either using the `MASTODON_BOT_CONFIG` environment variable or passing the path to config as an argument
* run the bot: `./mastodon-bot.cljs`
* to poll at intervals setup a cron job such as:
*/30 * * * * mastodon-bot.cljs /path/to/config.edn > /dev/null 2>&1
## License ## License