From 666cd333608d5fcd40f67fc6235e47a557aafc9c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 29 Jan 2016 15:38:05 +0300 Subject: enable support for readability (if af_readability is enabled) in shareanything bookmarklet --- classes/article.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'classes/article.php') diff --git a/classes/article.php b/classes/article.php index 01f6b5126..e47da8617 100644 --- a/classes/article.php +++ b/classes/article.php @@ -88,6 +88,20 @@ class Article extends Handler_Protected { $owner_uid) { $guid = 'SHA1:' . sha1("ttshared:" . $url . $owner_uid); // include owner_uid to prevent global GUID clash + + if (!$content) { + $pluginhost = new PluginHost(); + $pluginhost->load_all(PluginHost::KIND_ALL, $owner_uid); + + $af_readability = $pluginhost->get_plugin("Af_Readability"); + + if ($af_readability) { + $extracted_content = $af_readability->extract_content($url); + + if ($extracted_content) $content = db_escape_string($extracted_content); + } + } + $content_hash = sha1($content); if ($labels_str != "") { -- cgit v1.2.3