Fortudonv4-dev(20200407)
FortudonisaFediversebotdesignedforpostingrandomBSD-stylefortunesdirectlytoMastodonandPleromainstances.Itincorporatesaforkoffortune.pyandincludesitsownFediversebotfeatures.
REQUIREMENTS:
Python3.6orhigherMastodon.pyanditsdependenciescurlFortunefiles,suchasthoseprovidedwithfortune-modorBSDfortuneDIFFERENCESBETWEENFORTUDONANDFORTUNE.PY:
Theoriginalfortune.pywascreatedbyMichaelGoerzin2008.ItwasonlycompatiblewithPython2.cPicklewasusedtocreatedatafiles,withprotocolversion2andextension.pdat.Theprogramworkedinconsistentlydependingontheterminal'scharacterencoding.Offensivefortunefilesendingin-oweresupported,butunliketraditionalBSDfortune,thesefilesarenotROT13-rotated.
https://www.physik.fu-berlin.de/~goerz
fortune.pywasforkedbyVolkerKettenbachin2018andwasdesignedtoworkwithPython3.7.1andUTF-8fortunefiles.cPicklewasreplacedwithPickle,andprotocolwasleftcompatibleatlegacyversion2.
https://gitlab.com/volkerkettenbach/fortune-api/tree/master
FortudonwasforkedfromKettenbach'sfortune.pyin2020byredneonglow.Changesweremadewithregardtouseoflegacycode.Thepickleprotocolwaschangedtoversion4andthefileextensionisnow.p4dat.Aswiththetraditionalfortunepackage,offensivefortunefilesmustbeROT13-rotatedinadditiontoendingin-o.PostingandsearchingoffensivefortuneswillautomaticallyapplyROT13asneeded.
FortudonisdesignedasaFediversebotwithbuiltinsupportforpostingfortunestoPleromaandMastodoninstances.CodefromDarkWebMysteryBot(anotherFediversebotbyredneonglow)wasincorporatedintoFortudon.
https://github.com/redblade7/darkwebmysterybot
Fortudon,likefortune.py,islicensedundertheGPLv3.
TheofficialWebsiteforFortudonis:
https://github.com/redblade7/fortudon
NOTEFORSLACKWARELINUXUSERS:
SlackwareLinux,bydefault,useslatin1encodingratherthanUTF-8ontheterminalandinitsfortunefiles.Thisoccasionallyleadstostrangeerrorswhentryingtocreatethe.p4datfiles,suchas:
'utf-8'codeccan'tdecodebyte0xa3inposition1293:invalidstartbyte
Forthisreason,Slackwareusersmaywanttoforcelatin1encodingratherthanutf8.Todothis,editfortudon.py's"GLOBALVARIABLES"sectionandchangethevalueofENCODINGfrom'utf8'to'latin1'.
Thisalmostneverneedstobechanged.Itisrecommendedtoleaveit'utf8'unlessyouuseSlackwareLinuxandarehavingtheseerrors,otherwiseseriousbugscanhappen.
SETUPTHETOKENFILE:
CreateaFediverseaccountforyourFortudonbot.Setupatokenhere:https://tinysubversions.com/notes/mastodon-bot/Createatokenfilebyrunningthiscommand:curl<commandyouaregiven>>tokenfile.jsonNotethatifyouchangethepasswordontheaccount,youwillneedtocreateanewtokenfile.
EXAMPLECOMMANDS:
Showhelp:./fortudon.py-h
Showversion:./fortudon.py-v
Generaterequired.p4datdatafilesforfortunesinfolderfortune-folder:./fortudon.py-ufortune-folder
Displayrandomfortunechosenfromnon-offensivefilesinfortune-folder:./fortudon.pyfortune-folder
Displayrandomlongfortunechosenfromeitherfortune-folder/myfortunes1orfortune-folder/myfortunes2:./fortudon.py-lfortune-folder/myfortunes1fortune-folder/myfortunes2
Postrandomshortfortune,choosingfrombothoffensiveandnon-offensivefilesinfortune-folder,toPleromainstanceNeckbeard,usingtokenfiletokenfile.jsonandpublicvisibility:./fortudon.py-saphttps://neckbeard.xyztokenfile.jsonpublicfortune-folder
Postrandomshortfortune,chosenfromnon-offensivefilesinfortune-folder,toMastodoninstancemastodon.social,usingtokenfilewokenfile.jsonandunlistedvisibility:./fortudon.py-sphttps://mastodon.socialwokenfile.jsonunlistedfortune-folder
VISIBILITY:
Thevisibilityoptionmaybeanyofthefollowing:
direct(onlyvisibletothebotaccount)private(onlyvisibletothebotaccount'sfollowers)public(visibletoeveryone)unlisted(visibletoeveryone,buthiddenfromthepublictimeline)Inmostcasesyouwouldwanttouseeitherpublicorunlistedforthevisibilityoption.
Enjoy!
-redblade7akaredneonglow
FEDIVERSECONTACTINFO:
@redneonglow@neckbeard.xyz/https://neckbeard.xyz/redneonglow(main)@redneonglow@anime.website/https://anime.website/redneonglow(backup)@redneonglow@weeaboo.space/https://weeaboo.space/redneonglow(backup)FEDIVERSEBOTSUSINGFORTUDON:
@BitchX@neckbeard.xyz/https://neckbeard.xyz/BitchX@fortunebot@neckbeard.xyz/https://neckbeard.xyz/fortunebot@ShowerThoughts@neckbeard.xyz/https://neckbeard.xyz/ShowerThoughts@YKYWTMSMW@neckbeard.xyz/https://neckbeard.xyz/YKYWTMSMW
评论