]> git.mxchange.org Git - friendica-addons.git/blobdiff - twitter/twitter.php
privacy_image_cache: removed experimental resize
[friendica-addons.git] / twitter / twitter.php
index 2849db968f8b1f1d41e5f2cbce1de9d913aef1e5..cb7b03bb37086faa6464443838a0fc00d404e982 100755 (executable)
@@ -326,9 +326,9 @@ function twitter_post_hook(&$a,&$b) {
                        // recycle 1
                        $recycle = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8');
                        $tmp = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', $recycle.'$2', $tmp);
-                       // recycle 2
-                       //$recycle = html_entity_decode("♻ ", ENT_QUOTES, 'UTF-8');
-                       //$tmp = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', 'RT @$2:', $tmp);
+                       // recycle 2 (Test)
+                       $recycle = html_entity_decode("◌ ", ENT_QUOTES, 'UTF-8');
+                       $tmp = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', $recycle.'$2', $tmp);
                 }
                 $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/url\]/i', '$2 $1', $tmp);
                 $tmp = preg_replace( '/\[bookmark\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/bookmark\]/i', '$2 $1', $tmp);
@@ -367,6 +367,9 @@ function twitter_post_hook(&$a,&$b) {
                         $msg = implode(' ', $e);
                        $msg .= '... ' . $shortlink;
                }
+
+               $msg = trim($msg);
+
                // and now tweet it :-)
                if(strlen($msg)) {
                        $result = $tweet->post('statuses/update', array('status' => $msg));