tootgroup.py-emulategroupaccoutsoMastodoadPleromaWhatisthis?
Somesocialmediaplatformsallowgroupsofuserstopostitoauified"group"timelie/istace/whateveryouwattocallit.ThisiscurretlyotpossibleoMastodoorPleromawithoutgivigallmembersfulllogicredetialstoagroup.tootgroup.pyisaattempttosolvethisspecificusecase.
Howdoesitwork?tootgroup.pyhastobesetupoacomputeradruperiodically.ItreadstheotificatiosfromtheMastodo/Pleromaaccoutitiscoectedtoadfiltersthemformessagestorepost.Therearetwomethodsofcreatigagrouppost.Oeorbothofthemcabeeableddurigthesetupprocedure.
Publicmetiosofgroupmembersareboostediftheypreceedthegroup'samewithaExclamatioMarklike"!@mastodo"
tootgroup.pycaalsolookfordirectmessagesfromgroupmembers.Ifthegroupis@metioedattheverybegiig,Themessagewillberepostedasaewpublictootorigiatigdirectlyfromthegroupaccout.Thestatustextaswellasmediafilesareicluded.Theorigiatiguserwillotbeshowpublicly.(Itcastillbeseebyallgroupadistaceadmiistratorstough!)
Ifbothrepostmethodsaredisabled,tootgroup.pywillstillrubutotrepostaythig.
Buthowtosimplyuseit?Writeamessagethatshouldbeboostedbythegroup:Justiclude"!@group_ame"aywhereithetoot.EXAMPLE:"OHAI!justfoudthat!@mastodothigie!"
Writeamessagethatshouldappearasaewpostfromthegroup:Put"@group_ame"attheverybegiigofadirect/privatemessage.EXAMPLE:"@mastodoHEREBETHEMESSAGETEXT"
Howtosetup?Theeasiestwaytoistalltootgroup.pyisviaPyPI,thePythoPackageIdex.Usepip3istalltootgroup.pytoistallitaswellasallitsdepedecies.
ItisalsopossibletodowloadthescriptmauallyfromtheGitHubrepositoryathttps://github.com/oe4ds/tootgroup.pyIthatcasetheecessarydepedecieshavetobeprovidedtoo:
tootgroup.pyrequireshttps://github.com/halcy/Mastodo.pyaswellashttps://github.com/ActiveState/appdirstoru.Istallthemviayouroperatigsystem'spackagemaager,piporevemaually.
tootgroup.pywillguideyouthroughsetupbyaskigalliformatioiteedswheyouruitfromthecommadlieforthefirsttime.BeigsomewhatcomfortablewithPythoscriptigadthecommadlieigeeralmighthelpifdifficultiesshouldappear.
YoueedaaccoutoayMastodoorPleromaistacethatwillactasyourgroupaccout.Thikaboutifyoushouldmarkitasa"Bot".
Rutootgroup.pyfromthecommadlie.
tootgroup.pywillaskyouforalleededsetupdataadtrytogetthemrightbycoectigtotheMastodo/Pleromaserver.Ifitcaotdoso,itwilltellyouadyoucaretry.Whesuccessful,tootgroup.pywillwritethecofiguratiotoitstootgroup.coffileadreaditfromthereexttimeyouruthescript.
Theplaceforstorigcofiguratioisoperatigsystemdepedetbutwillbeshowdurigthefirst-ru/setupphase.Alocaltootgroup.coffileplacedexttothetootgroup.pyscriptwilloverridethesesettigsthoughadcabeusedfordevelopmetortestigpurposes.
Ifyouwattosetuptootgroup.pyformorethaoegroup,youcaruitagaiwhilespecifyigthe"--groupGROUP_HANDLE"flag.Thiswillthegeerateaidepedetcofiguratiothatwillbereadeachtimeyoucalltootgroup.pyusigthisame.Ifyoudo'tspecifyaygroupame,thehadle"default"iscreatedadusedautomatically
Testthefucioalitybysedigdirectmessagesad"!@metios"toyourgroupwhileruigtootgroup.pymaually.Seeifthigsworkasexpected.Thescriptwillpritaaccordigmessageaftereachsuccessfulru.Ifeverythigworks,ruthescriptperiodicallyviacroadejoygroop-tootig!
Hereisaexampleforacrotabetrythatrustootgroup.pyeverytwomiutes:
*/2****/path/to/tootgroup.py--groupdefault
Thereisalsothe"-d"or"--dry-ru"commadlieflagthatprevetsaytoots.Youcauseittotestwhatwouldbepostedbythescript.
Use"-h"or"--help"formoreiformatioaboutallavailableoptios







评论