kalvn / shaarli2mastodon Goto Github PK
View Code? Open in Web Editor NEWThis Shaarli plugin allows you to automatically publish links you post on your Mastodon timeline.
License: MIT License
This Shaarli plugin allows you to automatically publish links you post on your Mastodon timeline.
License: MIT License
Shaarli v0.12.0 has been released: https://github.com/shaarli/Shaarli/releases/tag/v0.12.0
Some changes seem to be required for plugins. I get this error:
shaarli2mastodon [plugin incompatibility]: Class 'Shaarli\Router' not found
Cheers!
I recently upgraded to Shaarli 11.1 (under PHP 7.4.15) and noticed enabling shaarli2mastodon results in Shaarli only displaying a blank page.
rm -r shaarli2mastodon/
under the plugins
directory restores Shaarli.
I've downloaded the latest v3.0.0 version to use with Shaarli 0.12.1
When I activate this plugin, I get the following error in apache logs
[Thu Nov 03 07:20:41.947608 2022] [php:error] [pid 4221] [client 192.168.0.254:51964]
PHP Fatal error: Uncaught Error: Class "Shaarli\\Render\\TemplatePage" not found in /var/www/html/Shaarli/plugins/shaarli2mastodon/shaarli2mastodon.php:51
Stack trace:
#0 [internal function]: hook_shaarli2mastodon_render_includes()
#1 /var/www/html/Shaarli/application/plugin/PluginManager.php(115): call_user_func()
#2 /var/www/html/Shaarli/index.php(574): Shaarli\\Plugin\\PluginManager->executeHooks()
#3 /var/www/html/Shaarli/index.php(1953): renderPage()
#4 {main}
thrown in /var/www/html/Shaarli/plugins/shaarli2mastodon/shaarli2mastodon.php on line 51,
referer: https://nicolas-delsaux.hd.free.fr/Shaarli/?do=pluginadmin
And Shaarli UI doesn't shows up
A shaarlink can feature a pretty long comment, which, in turn can become hard to read on mastodon.
This problem can be solved with the use of the native Content Warning feature of Mastodon. It would require an optional MASTODON_CW_FORMAT which would be an empty string by default and accept the same format tags as MASTODON_TOOT_FORMAT.
When this option is filled up, the plugin would put its formatted content in the mastodon Content Warning field.
As for the length issues that may rise by having two places to check instead of one, Mastodon considers the length of a toot as being [CW field length] + [Toot field length] so it should not be much of a hassle to deal with.
And for the use case, consider the readability of these example posts :
MASTODON_TOOT_FORMAT : ${title}\n\n${description}\n\n-- ${url}\n\n${tags} #shaarlien
MASTODON_CW_FORMAT : ${title}
MASTODON_TOOT_FORMAT : ${description}\n\n-- ${url}\n\n${tags} #shaarlien
I have stumbled on a URL that makes the "Publish on Mastodon" functionality disappear. I'm not sure this is real, and I'm hoping others can confirm or quash this ticket easily.
My environment
Create a new Shaare,
https://indieweb.org/POSSE
in URL -> the "Publish on Mastodon" tick mark and line are gone!https://indieweb.org/posse
-> OK againNote that the server indieweb.org
redirects the lower-case URL to the upper-case URL. I'm not sure if this is causing this Shaarli/shaarli2mastodon behaviour.
At first, I thought shaarli2mastodon was malfunctioning simply because the URL contained upper-case letters, but I've tested with other (existant and non-existant) URLs containing uppercase letters, and this behaviour was not observed.
In addition, I tested this with the Shaarli setting "private links by default" both on/off, and interestingly, in both cases the suspect URL above caused the new Shaare to be preset as Private and the disappearance of the "Publish on Mastodon" line. Unticking the Private box did not cause the "Publish on Mastodon" to reappear.
So it seems this particular web server is doing something that somehow forces Shaarli to create a private share, irrespective of the global setting, which causes shaarli2mastodon to hide the button? But shaarli2mastodon should always display its option on new Shaares, whether the global Private setting is enabled or not. Which it does, except for this URL.
Is this for real? Can anyone reproduce?
Hello.
What about removing markdown signs before sharing ?
An example :
After writing up this issue, I realised my mistake and fixed it. I'm posting this text anyway in the hopes it may help others get started with this useful project.
I can't share any new shaares with Mastodon. Everything looks as expected, until clicking "Save" in Shaarli, and being greeted with a completely white page stating only:
Error: "Could not resolve host: https" - Code: 6
My environment:
Steps I have taken:
I created a new app in my Mastodon account, with
"Application name": shaarli2mastodon
,
"Application website": https://github.com/kalvn/shaarli2mastodon
,
"Redirect URI": urn:ietf:wg:oauth:2.0:oob
(pre-filled default, left as-is),
and selected only scope write
.
I noted and saved the generated Client key
, Client secret
and Access token
.
Then I cloned and enabled the shaarli2mastodon plugin in Shaarli, and put the following values into the config form:
FIELD | VALUE |
---|---|
MASTODON_INSTANCE | https://scholar.social |
MASTODON_APPID | "client key" from app settings in Mastodon |
MASTODON_APPSECRET | "client secret" from app settings in Mastodon |
MASTODON_APPTOKEN | "access token" from app settings in Mastodon |
MASTODON_TOOT_FORMAT | ${title} ${description} ${permalink} |
I have played around a little with these settings, but I'll spare you the details of my blind testing.
Suffice it to say, I feel confident that I'm probably missing something obvious.
Hello,
Thank you very much for this plugin.
It works perfectly :)
I just have a little problem when I add a link. It is well inserted in Mastodon but I have the following message (just before the pop-up closes):
Notice: Undefined index: client_name in /path/to/shaarli/plugins/shaarli2mastodon/Mastodon/Mastodon.php on line 66
Notice: Undefined index: website /path/to/shaarli/plugins/shaarli2mastodon/Mastodon/Mastodon.php on line 67
Nothing blocking however
Edit : I'm on shaarli 0.9.2
There is a breaking change for all plugins in Shaarli future release due to the introduction of namespaces.
See ArthurHoaro/shaarli2twitter@c05d044
Shaarli v0.11.0 won't be released anytime soon at its current pace of development, but the plugin isn't currently compatible with the master
branch. Maybe you should release the current state of this repo while it's compatible with v0.10.x.
Check why this link were not shared on Mastodon: https://links.kalvn.net/shaare/bFSt4w
When posting from the "Shaare link" button, an checkbox to "Publish to Mastodon" is available.
It would be useful to also have that box when editing a link in Shaarli, so the link can be published again.
First I thought its because of a mastodon-server-update, but I've tried it with accounts on instances with v3.2.1 and v3.2.0:
nothing.
Now I've updated to shaarli 12.1:
everything works, but not this plugin.
Any idea?
Would be so great! :)
Hello,
First of all, thank you for you plugin, that's really an easy way to publish to mastodon from shaarli.
I tried to publish a "note", not share a link. So as you can see the only the ID of my note is displayed on the toot : https://octodon.social/@husimo/98919611210256252
Is there a way to include the whole link ?
And is there a possibility for a parameter which allow me to not display link to shaarli when it's a note and characters are <= 500 ?
Thank you, keep the good work 👍
Hello.
Sur Shaarli 0.10.4 et en PHP 7.3.9 j'ai cette erreur 👍
Fatal error: Cannot declare class Router, because the name is already in use in /home/XXX/liens/application/Router.php on line 8
I am using Shaarli and Shaarli2mastodon with my Pleroma instance, where the default toot/status length is much higher than 500 characters.
Would it be possible to add an editable parameter to change the toot length?
Tags with accented characters (such as é and à) issue are published on Mastodon without these characters (i.e. #éléphant is published #lphant)
Hi,
I've just discovered your plugin and my server uses php7.0. I'm wondering if shaarli2mastidon supports php7.0 or only php5.x ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.