Giter VIP home page Giter VIP logo

shaarli2mastodon's People

Contributors

kalvn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

arthurhoaro

shaarli2mastodon's Issues

Not compatible with Shaarli 11.1

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.

Activating this plugin prevents shaarli from loading

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

Allow the use of content warnings

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
capture d ecran_2017-11-11_08-53-47

MASTODON_CW_FORMAT : ${title}
MASTODON_TOOT_FORMAT : ${description}\n\n-- ${url}\n\n${tags} #shaarlien
capture d ecran_2017-11-11_08-56-42

"Publish on Mastodon" functionality disappears for certain URLs?

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

  • Shaarli 0.12.1 in Firefox 78.5.0esr 64-bit, also tested in Chromium 87.0.4280.66
  • shaarli2mastodon v2.0.0 or latest commit, made no difference
  • PHP 7.3.23-4+ubuntu18.04.1+deb.sury.org+1
  • Ubuntu 18.04.5

Create a new Shaare,

  • leave URL empty -> "Publish on Mastodon" visible OK
  • input https://indieweb.org/POSSE in URL -> the "Publish on Mastodon" tick mark and line are gone!
  • https://indieweb.org/posse -> OK again

Note 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?

Error: "Could not resolve host: https" - Code: 6

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:

  • Shaarli 0.12.1 in Firefox 78.5.0esr 64-bit, also tested in Chromium 87.0.4280.66
  • shaarli2mastodon latest commit 6c8a93a
  • PHP 7.3.23-4+ubuntu18.04.1+deb.sury.org+1, with the curl module enabled
  • Ubuntu 18.04.5

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.

Notice Undefined index after form validation

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

Use namespaces for future Shaarli v0.11

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.

Suddenly stopped working on 13.11.2020

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! :)

Notes

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 👍

Erreur "class router"

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

Allow customization of the toot length

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?

Php7.0 compatibility ?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.