[SOLVED] Allow third-party fulltext fetcher in af_readability

I know there is a plugin called mercury_fulltext for this, but it can not work for bookmarklets since bookmarklets it harded-coded to call the “extract_contents” in af_readability.

It would be great if af_readability could have an option for setting a URL to a third-party fulltext fetcher, like in mercury_fulltext/init.php at master · HenryQW/mercury_fulltext · GitHub

A web-based API allows processing the feed with any programming language, which opens up the opportunity for further integration with other existing applications.

  1. af_readability is going to continue using readability. i hope i don’t need to explain why.
  2. you can always make a different bookmarklets plugin which would do whatever you want
  3. i’m all for adding more plugin hooks but there has to be a line drawn somewhere

as a more generic solution i’ve added a separate plugin hook (HOOK_GET_FULL_TEXT) which could be provided by any plugin implementing full text service; at the moment the only place its being used is the one where ad_readability was previously invoked by name, but this could be extended.

additionally, this could be used by other plugins, which might want to get full article text in a generic way.

https://git.tt-rss.org/fox/tt-rss/commit/6955b2e02d4893fd88009a8162d45b6c8b3514c6

i haven’t tested this but it should work.

I have just tested the updated code. It doesn’t seem to be working.
The log shows

Methods with the same name as their class will not be constructors in a future version of PHP; SphinxClient has a deprecated constructor
1. plugins/search_sphinx/init.php(20): ttrss_error_handler(8192, Methods with the same name as their class will not be constructors in a future version of PHP; SphinxClient has a deprecated constructor, plugins/search_sphinx/sphinxapi.php, 384, Array)
2. plugins/search_sphinx/init.php(20): require_once()
3. classes/pluginhost.php(240): init([PluginHost])
4. classes/pluginhost.php(162): load(af_comics,af_fsckportal,af_psql_trgm,af_readability,af_redditimgur,af_tumblr_1280,af_unburn,af_youtube_embed,af_zz_imgproxy,af_zz_noautoplay,af_zz_vidmute,auth_internal,auth_remote,auto_assign_labels,bookmarklets,cache_starred_images,close_button,fever,googlereaderkeys,hotkeys_noscroll,import_export,mail,mailto,no_iframes,no_title_counters,no_url_hashes,note,nsfw,opencc,search_sphinx,share,shorten_expanded,swap_jk,toggle_sidebar,vf_shared, 1, 1, )
5. classes/article.php(100): load_all(1, 1)
6. classes/handler/public.php(578): create_published_article(TEST TITLE, http://localhost:8081/TEST, , , 1)
7. public.php(50): sharepopup()

It seems that the fetched content is empty

you’re right, this should be fixed by https://git.tt-rss.org/fox/tt-rss/commit/fda475bd930891cab422597ded679c1cc8ff7215

I tried the https://git.tt-rss.org/fox/tt-rss/commit/bf5dfc444e11aa84b1ad193c1901b9919c5effac and it is still not working. The article is not even created and the pop up stucks after I click “Share” button.
The “SphinxClient has a deprecated constructor” warning disappeared, though.

I also tried returning a string “test” directly here, but the problem remains
https://git.tt-rss.org/fox/tt-rss/src/fda475bd930891cab422597ded679c1cc8ff7215/plugins/af_readability/init.php#L245

Is is not from the plug-in but somewhere else?

your php doesn’t have UConverter? post your php version

on debian its probably php7.0-intl package

My php version is 7.2.17
It is intalled via

apk add --update --no-cache nginx s6 php7 php7-fpm php7-cli php7-curl php7-fileinfo php7-mbstring php7-gd php7-json php7-dom php7-pcntl php7-posix \
  php7-pgsql php7-mcrypt php7-session php7-pdo php7-pdo_pgsql ca-certificates

well install the intl package then? it’s a hard requirement now anyway because of SQL logging.

e: i’ve updated https://git.tt-rss.org/fox/tt-rss/wiki/PhpCompatibilityNotes

It worked after installing the intl package :slight_smile:

On Ubuntu 18.04.2 LTS, running: sudo apt-get install php7.2-intl did the trick. To be fair, the error message I got from the ttrss page was pretty clear which package I needed. A simple Google search showed that I needed php*-intl whatnot.