diff options
author | Andrew Dolgov <[email protected]> | 2016-01-29 15:38:05 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-01-29 15:38:05 +0300 |
commit | 666cd333608d5fcd40f67fc6235e47a557aafc9c (patch) | |
tree | 76fd40d300fb49cff525e3efcfeabd4c1fc95486 /classes | |
parent | 4501d5ef454cc08cc6f992dbc8d0341fe0d12b48 (diff) |
enable support for readability (if af_readability is enabled) in shareanything bookmarklet
Diffstat (limited to 'classes')
-rw-r--r-- | classes/article.php | 14 |
1 files changed, 14 insertions, 0 deletions
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 != "") { |