Package: collective.mastodon
collective.mastodoncollective.mastodonis a package providing aPlonecontent rules action to post a status to a Mastodon instance.InstallationThis package supports Plone sites using Volto and ClassicUI.For proper Volto support, the requirements are:plone.restapi >= 8.34.0Volto >= 16.10.0Addcollective.mastodonto the Plone installation usingpip:pipinstallcollective.mastodonor add it as a dependency on your package'ssetup.pyinstall_requires=["collective.mastodon","Plone","plone.restapi","setuptools",],ConfigurationObtaining an Access TokenBefore you can use this package, you have to register an application on Mastodon.
To do so, log in to your account, visitsettings/applications/newand create the application. (Please selectreadandwritescopes, and keep the defaultRedirect URI).
Go to the newly created application page and copy the value ofYour access token.Configuring PloneThis package is configured via theMASTODON_APPSenvironment variable which should contain a valid JSON array with your Mastodon Application information.Each application registration requires the following information:KeyDescriptionExample ValuenameIdentifier for the applicationlocalhost-userinstanceURL of your instance, without the trailing slashhttp://localhosttokenAccess token of your Mastodon ApplicationjutbgrhNDS1EvUvpoHD0ox4a7obSCT9_IpliStv799MuserUser on the Mastodon instance. (Only used to generate a friendly name on Plone)userUsing the information above, the environment variable would look like:MASTODON_APPS='[{"name": "localhost-user","instance":"http://localhost","token":"jutbgrhNDS1EvUvpoHD0ox4a7obSCT9_IpliStv799M","user":"user"}]'Starting PloneNow, you can start your local Plone installation with:MASTODON_APPS='[{"name": "localhost-user","instance":"http://localhost","token":"jutbgrhNDS1EvUvpoHD0ox4a7obSCT9_IpliStv799M","user":"user"}]'makestartor, if you are using adocker composeconfiguration, add the new environment variable under theenvironmentkey:environment:-MASTODON_APPS='[{"name":"localhost-user","instance":"http://localhost","token":"jutbgrhNDS1EvUvpoHD0ox4a7obSCT9_IpliStv799M","user":"user"}]'After start-up visit theContent RulesControl Panel, and create a new content rule.No additional configuration is needed for Volto support.ContributingIf you want to help with the development (improvement, update, bug-fixing, ...) ofcollective.mastodonthis is a great idea!Issue TrackerSource CodeDocumentationWe appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us.Local DevelopmentYou need a workingpythonenvironment (system,virtualenv,pyenv, etc) version 3.8 or superior.Then install the dependencies and a development instance using:makebuildUpdate translationsmakei18nFormat codebasemakeformatRun testsTesting of this package is done withpytestandtox.Run all tests with:maketestRun all tests but stop on the first error and open apdbsession:./bin/tox-etest---x--pdbRun only tests that matchTestAppDiscovery:./bin/tox-etest---kTestAppDiscoveryRun only tests that matchTestAppDiscovery, but stop on the first error and open apdbsession:./bin/tox-etest---kTestAppDiscovery-x--pdbTranslationsThis product has been translated into:English (Érico Andrei)Português do Brasil (Érico Andrei)LicenseThe project is licensed under GPLv2.One Last ThingOriginally Made in São Paulo, Brazil, with love, by your friends @ Simples Consultoria.Now maintained by thePlone CollectiveContributorsÉrico Andrei, @ericofChangelog1.0.0a2 (2023-08-26)New features:Rewrite keywords with spaces and dashes [@ericof]#11.0.0a1 (2023-08-25)Initial release [@ericof]