Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Andreas Demmelbauer 6ca8782ac0 add installation instructions, fix cron example pirms 6 gadiem
.gitignore git ignore logs pirms 6 gadiem
LICENSE Initial commit pirms 7 gadiem
README.md add installation instructions, fix cron example pirms 6 gadiem
config-example.json add time delay between toots pirms 6 gadiem
cron-example.sh add installation instructions, fix cron example pirms 6 gadiem
requirements.txt added soup.io, added dry run, changed cli, added config file pirms 6 gadiem
tootbot.py fixing bug: not checking soup posts if already posted; configpath errormessage was also misleading pirms 6 gadiem

README.md

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.

For Twitter, it gets the tweets from RSS available at http://twitrss.me, then does some cleanup on the content:

  • twitter tracking links (t.co) are dereferenced
  • twitter hosted pictures are retrieved and uploaded to mastodon

For Soup, it uses the official RSS feed (e.g. https://metalab.soup.io/rss), then does some cleanup on the content:

  • checks if source is twitter and checks for duplicates
  • removes html stuff
  • looks for one picture in source link or in soup post and uploads it to mastodon
  • adds source url (if no source is specified, soup post is source url)

A sqlite database is used to keep track of items than have been tooted.

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).