fortudon

Fediverse fortune bot
授权协议 GPL-3.0 License
开发语言 Python
所属分类 应用工具、 IM/聊天/语音工具
软件类型 开源软件
地区 不详
投 递 者 郑翰海
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

fortudon

Fortudon v4-dev (20200407)

Fortudon is a Fediverse bot designed for posting random BSD-style fortunesdirectly to Mastodon and Pleroma instances. It incorporates a fork offortune.py and includes its own Fediverse bot features.

REQUIREMENTS:

  • Python 3.6 or higher
  • Mastodon.py and its dependencies
  • curl
  • Fortune files, such as those provided with fortune-mod or BSD fortune

DIFFERENCES BETWEEN FORTUDON AND FORTUNE.PY:

The original fortune.py was created by Michael Goerz in 2008. It was onlycompatible with Python 2. cPickle was used to create data files, withprotocol version 2 and extension .pdat. The program worked inconsistentlydepending on the terminal's character encoding. Offensive fortune filesending in -o were supported, but unlike traditional BSD fortune, these filesare not ROT13-rotated.

http://www.physik.fu-berlin.de/~goerz

fortune.py was forked by Volker Kettenbach in 2018 and was designed to workwith Python 3.7.1 and UTF-8 fortune files. cPickle was replaced with Pickle,and protocol was left compatible at legacy version 2.

https://gitlab.com/volkerkettenbach/fortune-api/tree/master

Fortudon was forked from Kettenbach's fortune.py in 2020 by redneonglow.Changes were made with regard to use of legacy code. The pickle protocolwas changed to version 4 and the file extension is now .p4dat. As with thetraditional fortune package, offensive fortune files must be ROT13-rotated inaddition to ending in -o. Posting and searching offensive fortunes willautomatically apply ROT13 as needed.

Fortudon is designed as a Fediverse bot with built in support for postingfortunes to Pleroma and Mastodon instances. Code from Dark Web Mystery Bot(another Fediverse bot by redneonglow) was incorporated into Fortudon.

https://github.com/redblade7/darkwebmysterybot

Fortudon, like fortune.py, is licensed under the GPLv3.

The official Web site for Fortudon is:

https://github.com/redblade7/fortudon

NOTE FOR SLACKWARE LINUX USERS:

Slackware Linux, by default, uses latin1 encoding rather than UTF-8 on the terminal and in its fortune files. This occasionally leads to strange errors when trying to create the .p4dat files, such as:

'utf-8' codec can't decode byte 0xa3 in position 1293: invalid start byte

For this reason, Slackware users may want to force latin1 encoding rather thanutf8. To do this, edit fortudon.py's "GLOBAL VARIABLES" section and changethe value of ENCODING from 'utf8' to 'latin1'.

This almost never needs to be changed. It is recommended to leave it 'utf8'unless you use Slackware Linux and are having these errors, otherwise seriousbugs can happen.

SET UP THE TOKEN FILE:

  1. Create a Fediverse account for your Fortudon bot.
  2. Set up a token here: https://tinysubversions.com/notes/mastodon-bot/
  3. Create a token file by running this command:curl <command you are given> > tokenfile.json

Note that if you change the password on the account, you will need to create a new token file.

EXAMPLE COMMANDS:

Show help: ./fortudon.py -h

Show version: ./fortudon.py -v

Generate required .p4dat data files for fortunes in folder fortune-folder: ./fortudon.py -u fortune-folder

Display random fortune chosen from non-offensive files in fortune-folder: ./fortudon.py fortune-folder

Display random long fortune chosen from either fortune-folder/myfortunes1 or fortune-folder/myfortunes2: ./fortudon.py -l fortune-folder/myfortunes1 fortune-folder/myfortunes2

Post random short fortune, choosing from both offensive and non-offensive files in fortune-folder, to Pleroma instance Neckbeard, using token file tokenfile.json and public visibility: ./fortudon.py -sap https://neckbeard.xyz tokenfile.json public fortune-folder

Post random short fortune, chosen from non-offensive files in fortune-folder, to Mastodon instance mastodon.social, using token file wokenfile.json and unlisted visibility: ./fortudon.py -sp https://mastodon.social wokenfile.json unlisted fortune-folder

VISIBILITY:

The visibility option may be any of the following:

  • direct (only visible to the bot account)
  • private (only visible to the bot account's followers)
  • public (visible to everyone)
  • unlisted (visible to everyone, but hidden from the public timeline)

In most cases you would want to use either public or unlisted for the visibility option.

Enjoy!

-redblade7 aka redneonglow

FEDIVERSE CONTACT INFO:

FEDIVERSE BOTS USING FORTUDON:

相关阅读

相关文章

相关问答

相关文档