Przeglądaj źródła

add installation instructions, fix cron example

master
Andreas Demmelbauer 6 lat temu
rodzic
commit
6ca8782ac0
2 zmienionych plików z 26 dodań i 5 usunięć
  1. +19
    -1
      README.md
  2. +7
    -4
      cron-example.sh

+ 19
- 1
README.md Wyświetl plik

@@ -1,6 +1,7 @@
# TootBot Spicy Edition

A small python 3.x script to replicate tweets and posts from soup.io on a mastodon account.
It's based on TootBot: https://github.com/cquest/tootbot

The script only need mastodon login/pass to post toots.

@@ -18,6 +19,23 @@ For Soup, it uses the official RSS feed (e.g. https://metalab.soup.io/rss), then
A sqlite database is used to keep track of items than have been tooted.


this script is based on TootBot: https://github.com/cquest/tootbot
This script ist used by metalab: https://chaos.social/@metalab

## Installation

You may want to run it in a virtualenv:
* Clone this repo with git.
* Download an install virtualenv from the repository and package manager of your favor.
* Create virtualenv: `virtualenv -p python3 ~/.virtualenvs/tootbot-spicy`
* Activate your new virtualenv: `source ~/.virtualenvs/tootbot-spicy/bin/activate`
* The `(tootbot)` in the prompt is indicating which virtualenv you are currently using.
* switch into the projects directory: `cd tootbot-spicy`
* Install requirements: `pip3 install -r requirements.txt`
* copy the config-example: `cp config-example.json config.json`.
* edit `config.json`
* copy the cron-example: `cp cron-example.sh cron.sh`.
* edit `cron.sh`
* add cronjob for `cron.sh`: `crontab -e`
* if you want to quit virtualenv environment, just type `deactivate`

The script is simply called by a cron job and can run on any server (does not have to be on the mastodon instance server).

+ 7
- 4
cron-example.sh Wyświetl plik

@@ -1,5 +1,8 @@
# activate virtualenv if necessary
# source /home/cquest/.virtualenvs/tootbot/bin/activate
#!/bin/bash
MY_PATH="`dirname \"$0\"`"
cd "$MY_PATH"

python tootbot.py config.json
python tootbot.py anotherconfig.json
# activate virtualenv
source ~/.virtualenvs/tootbot-spicy/bin/activate
python3 tootbot.py config.json
deactivate

Ładowanie…
Anuluj
Zapisz