]> git.mxchange.org Git - friendica-addons.git/commitdiff
Merge https://github.com/friendica/friendica-addons into apull
authorfriendica <info@friendica.com>
Mon, 26 Aug 2013 00:54:26 +0000 (17:54 -0700)
committerfriendica <info@friendica.com>
Mon, 26 Aug 2013 00:54:26 +0000 (17:54 -0700)
Conflicts:
twitter.tgz

15 files changed:
fbpost.tgz
fbpost/fbpost.php
fromgplus.tgz
fromgplus/fromgplus.php
public_server.tgz
public_server/public_server.php
pumpio.tgz
pumpio/oauth/oauth_client.php
pumpio/pumpio.php
statusnet.tgz
statusnet/statusnet.php
twitter.tgz [changed mode: 0755->0644]
twitter/twitter.php
wppost.tgz
wppost/wppost.php

index 823a4f3cb41cf9dc2ceda0728c5a91bb054a124b..7aefd5dbaa73b6da06a0c601077abb322c38d68a 100644 (file)
Binary files a/fbpost.tgz and b/fbpost.tgz differ
index ba60f4e64bdca3b6eb7c62ddbec399f340f7e2af..0fc6dd6544131a708285a01e8ac4512681009e35 100644 (file)
@@ -529,40 +529,6 @@ function fbpost_post_hook(&$a,&$b) {
                                // if($b['verb'] == ACTIVITY_DISLIKE)
                                //      $msg = trim(strip_tags(bbcode($msg)));
 
-                               // Old code
-                               /*$search_str = $a->get_baseurl() . '/search';
-
-                               if(preg_match("/\[url=(.*?)\](.*?)\[\/url\]/is",$msg,$matches)) {
-
-                                       // don't use hashtags for message link
-
-                                       if(strpos($matches[2],$search_str) === false) {
-                                               $link = $matches[1];
-                                               if(substr($matches[2],0,5) != '[img]')
-                                                       $linkname = $matches[2];
-                                       }
-                               }
-
-                               // strip tag links to avoid link clutter, this really should be 
-                               // configurable because we're losing information
-
-                               $msg = preg_replace("/\#\[url=(.*?)\](.*?)\[\/url\]/is",'#$2',$msg);
-
-                               // provide the link separately for normal links
-                               $msg = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/is",'$2 $1',$msg);
-
-                               if(preg_match("/\[img\](.*?)\[\/img\]/is",$msg,$matches))
-                                       $image = $matches[1];
-
-                               $msg = preg_replace("/\[img\](.*?)\[\/img\]/is", t('Image: ') . '$1', $msg);
-
-                               if((strpos($link,z_root()) !== false) && (! $image))
-                                       $image = $a->get_baseurl() . '/images/friendica-64.jpg';
-
-                               $msg = trim(strip_tags(bbcode($msg)));*/
-
-                               // New code
-
                                // Looking for the first image
                                $image = '';
                                if(preg_match("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/is",$b['body'],$matches))
@@ -604,25 +570,25 @@ function fbpost_post_hook(&$a,&$b) {
                                $body = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', "\n\t$2:\t", $body);
 
                                // share element
-                               $body = preg_replace_callback("/\[share(.*?)\]\s?(.*?)\s?\[\/share\]/ism","fbpost_ShareAttributes", $body);
+                               //$body = preg_replace_callback("/\[share(.*?)\]\s?(.*?)\s?\[\/share\]/ism","fbpost_ShareAttributes", $body);
 
-                               $bodyparts = explode("\t", $body);
+                               //$bodyparts = explode("\t", $body);
                                // Doesn't help with multiple repeats - the problem has to be solved later
-                               if (sizeof($bodyparts) == 3) {
-                                       $html = bbcode($bodyparts[2], false, false);
-                                       $test = trim(html2plain($html, 0, true));
-
-                                       if (trim($bodyparts[0]) == "")
-                                               $body = trim($bodyparts[2]);
-                                       else if (trim($test) == "")
-                                               $body = trim($bodyparts[0]);
-                                       else
-                                               $body = trim($bodyparts[0])."\n\n".trim($bodyparts[1])."[quote]".trim($bodyparts[2])."[/quote]";
-                               } else
+                               //if (sizeof($bodyparts) == 3) {
+                               //      $html = bbcode($bodyparts[2], false, false);
+                               //      $test = trim(html2plain($html, 0, true));
+
+                               //      if (trim($bodyparts[0]) == "")
+                               //              $body = trim($bodyparts[2]);
+                               //      else if (trim($test) == "")
+                               //              $body = trim($bodyparts[0]);
+                               //      else
+                               //              $body = trim($bodyparts[0])."\n\n".trim($bodyparts[1])."[quote]".trim($bodyparts[2])."[/quote]";
+                               //} else
                                        $body = str_replace("\t", "", $body);
 
                                // At first convert the text to html
-                               $html = bbcode($body, false, false);
+                               $html = bbcode($body, false, false, 2);
 
                                // Then convert it to plain text
                                $msg = trim($b['title']." \n\n".html2plain($html, 0, true));
@@ -1052,11 +1018,14 @@ function fbpost_fetchwall($a, $uid) {
                $_SESSION["authenticated"] = true;
                $_SESSION["uid"] = $uid;
 
+               unset($_REQUEST);
                $_REQUEST["type"] = "wall";
                $_REQUEST["api_source"] = true;
                $_REQUEST["profile_uid"] = $uid;
                $_REQUEST["source"] = "Facebook";
 
+               $_REQUEST["title"] = "";
+
                $_REQUEST["body"] = (isset($item->message) ? escape_tags($item->message) : '');
 
                if(isset($item->name) and isset($item->link))
index ce6f1b1465346c4902722fe568b26403b6c7444f..4c5fb12301838965c6c6d30ba8624923b14d0e1b 100644 (file)
Binary files a/fromgplus.tgz and b/fromgplus.tgz differ
index 5d0e86c3d92f00a3d5db725ad12ad3a9f270b99b..94b12af345647ce815c0ab1d8026bd0dcd53ed3c 100644 (file)
@@ -109,6 +109,7 @@ function fromgplus_post($a, $uid, $source, $body, $location) {
        $_SESSION['authenticated'] = true;
        $_SESSION['uid'] = $uid;
 
+       unset($_REQUEST);
        $_REQUEST['type'] = 'wall';
        $_REQUEST['api_source'] = true;
 
@@ -123,11 +124,16 @@ function fromgplus_post($a, $uid, $source, $body, $location) {
        $_REQUEST['body'] = $body;
        $_REQUEST['location'] = $location;
 
-        logger('fromgplus: posting for user '.$uid);
+       if (($_REQUEST['title'] == "") AND ($_REQUEST['body'] == "")) {
+               logger('fromgplus: empty post for user '.$uid." ".print_r($_REQUEST, true));
+               return;
+       }
 
        require_once('mod/item.php');
        //print_r($_REQUEST);
+        logger('fromgplus: posting for user '.$uid." ".print_r($_REQUEST, true));
        item_post($a);
+        logger('fromgplus: done for user '.$uid);
 }
 
 function fromgplus_html2bbcode($html) {
index 8fcf6108322fd8b778b06ee8bbf75ded3556e784..ec9c0177f7e926dfdd3ea96f763bf0469f80cd31 100755 (executable)
Binary files a/public_server.tgz and b/public_server.tgz differ
index 3711854f8a2e9f33c841bf0c76ac4f1239807f9b..becf96c34fc493aaafc1e7021a21f62e864af228 100644 (file)
@@ -43,9 +43,11 @@ function public_server_register_account($a,$b) {
        );
 
 };
-       
+
 
 function public_server_cron($a,$b) {
+       logger("public_server: cron start");
+
        require_once('include/enotify.php');
        $r = q("select * from user where account_expires_on < UTC_TIMESTAMP() + INTERVAL 5 DAY and account_expires_on > '0000-00-00 00:00:00' and
                expire_notification_sent = '0000-00-00 00:00:00' ");
@@ -116,6 +118,7 @@ function public_server_cron($a,$b) {
                }
         }
 
+       logger("public_server: cron end");
 
 }
 
index e2492b16167e89b2a699a8fe5fc75f156123c0a3..2441430798781e2cf252d7a95253b4e88aa61502 100644 (file)
Binary files a/pumpio.tgz and b/pumpio.tgz differ
index 5047e0e9b41f10d3e09aefcc54dbc55d434feb34..2a709aab4e8025af9d0c4278708a521e465e4769 100644 (file)
@@ -1013,7 +1013,8 @@ class oauth_client_class
                {
                        $values = array(
                                'oauth_consumer_key'=>$this->client_id,
-                               'oauth_nonce'=>md5(uniqid(rand(), true)),
+                               //'oauth_nonce'=>md5(uniqid(rand(), true)),
+                               'oauth_nonce'=>sha1(uniqid(mt_rand(), true).uniqid(mt_rand(), true)),
                                'oauth_signature_method'=>$this->signature_method,
                                'oauth_timestamp'=>time(),
                                'oauth_version'=>'1.0',
@@ -2173,4 +2174,4 @@ class oauth_client_class
 
 */
 
-?>
\ No newline at end of file
+?>
index da723eca9ddead886f7a4fbb3fca4caa61c1d640..60d8e82ffc148f3bd847fd996b912d1226076119 100755 (executable)
@@ -363,13 +363,24 @@ function pumpio_send(&$a,&$b) {
                if ($title != '')
                        $title = "<h4>".$title."</h4>";
 
+               $content = bbcode($b['body'], false, false);
+
+               // Enhance the way, videos are displayed
+               $content = preg_replace('/<a.*?href="(https?:\/\/www.youtube.com\/.*?)".*?>(.*?)<\/a>/ism',"\n[url]$1[/url]\n",$content);
+               $content = preg_replace('/<a.*?href="(https?:\/\/youtu.be\/.*?)".*?>(.*?)<\/a>/ism',"\n$1\n",$content);
+               $content = preg_replace('/<a.*?href="(https?:\/\/vimeo.com\/.*?)".*?>(.*?)<\/a>/ism',"\n$1\n",$content);
+               $content = preg_replace('/<a.*?href="(https?:\/\/player.vimeo.com\/.*?)".*?>(.*?)<\/a>/ism',"\n$1\n",$content);
+
+               $URLSearchString = "^\[\]";
+               $content = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism",'tryoembed',$content);
+
                $params = array();
 
                $params["verb"] = "post";
 
                $params["object"] = array(
                                        'objectType' => "note",
-                                       'content' => $title.bbcode($b['body'], false, false));
+                                       'content' => $title.$content);
 
                if ($public)
                        $params["to"] = array(Array(
@@ -385,14 +396,16 @@ function pumpio_send(&$a,&$b) {
                $client->client_id = $consumer_key;
                $client->client_secret = $consumer_secret;
 
+               $username = $user.'@'.$host;
+
                $success = $client->CallAPI(
                                        'https://'.$host.'/api/user/'.$user.'/feed',
                                        'POST', $params, array('FailOnAccessError'=>true, 'RequestContentType'=>'application/json'), $user);
 
                if($success)
-                       logger('pumpio_send: success');
+                       logger('pumpio_send '.$username.': success');
                else
-                       logger('pumpio_send: general error: ' . print_r($user,true));
+                       logger('pumpio_send '.$username.': general error: ' . print_r($user,true));
 
        }
 }
@@ -456,10 +469,12 @@ function pumpio_fetchtimeline($a, $uid) {
 
        logger('pumpio: fetching for user '.$uid.' '.$url.' C:'.$client->client_id.' CS:'.$client->client_secret.' T:'.$client->access_token.' TS:'.$client->access_token_secret);
 
+       $username = $user.'@'.$host;
+
        $success = $client->CallAPI($url, 'GET', array(), array('FailOnAccessError'=>true), $user);
 
        if (!$success) {
-               logger('pumpio: error fetching posts for user '.$uid." ".print_r($user, true));
+               logger('pumpio: error fetching posts for user '.$uid." ".$username." ".print_r($user, true));
                return;
        }
 
@@ -498,6 +513,7 @@ function pumpio_fetchtimeline($a, $uid) {
                                $_SESSION["authenticated"] = true;
                                $_SESSION["uid"] = $uid;
 
+                               unset($_REQUEST);
                                $_REQUEST["type"] = "wall";
                                $_REQUEST["api_source"] = true;
                                $_REQUEST["profile_uid"] = $uid;
@@ -505,6 +521,8 @@ function pumpio_fetchtimeline($a, $uid) {
 
                                if ($post->object->displayName != "")
                                        $_REQUEST["title"] = html2bbcode($post->object->displayName);
+                               else
+                                       $_REQUEST["title"] = "";
 
                                $_REQUEST["body"] = html2bbcode($post->object->content);
 
index d560e9b5adebc5e7d0838bf4fa9565e595772450..57ce110b98c49c6701784aa47c69c24bb7ee7937 100755 (executable)
Binary files a/statusnet.tgz and b/statusnet.tgz differ
index b3450d956393997d0317cd4e5f3281b9826451df..d168955cd4deec2e3d95350e8da7b12ad1d48f35 100755 (executable)
@@ -491,10 +491,10 @@ function statusnet_shortenmsg($b, $max_char) {
        $body = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', "\n", $body);
 
        // remove the share element
-       $body = preg_replace("/\[share(.*?)\](.*?)\[\/share\]/ism","\n\n$2\n\n",$body);
+       //$body = preg_replace("/\[share(.*?)\](.*?)\[\/share\]/ism","\n\n$2\n\n",$body);
 
        // At first convert the text to html
-       $html = bbcode($body, false, false);
+       $html = bbcode($body, false, false, 2);
 
        // Then convert it to plain text
        //$msg = trim($b['title']." \n\n".html2plain($html, 0, true));
@@ -563,13 +563,13 @@ function statusnet_shortenmsg($b, $max_char) {
                else if ($lastchar != "\n")
                        $msg = substr($msg, 0, -3)."...";
        }
-       $msg = str_replace("\n", " ", $msg);
+       //$msg = str_replace("\n", " ", $msg);
 
        // Removing multiple spaces - again
        while (strpos($msg, "  ") !== false)
                $msg = str_replace("  ", " ", $msg);
 
-       return(array("msg"=>trim($msg." ".$msglink), "image"=>$image));
+       return(array("msg"=>trim($msg."\n".$msglink), "image"=>$image));
 }
 
 function statusnet_post_hook(&$a,&$b) {
@@ -855,6 +855,9 @@ function statusnet_fetchtimeline($a, $uid) {
                if ($first_time)
                        continue;
 
+               if ($post->source == "activity")
+                       continue;
+
                if (is_object($post->retweeted_status))
                        continue;
 
@@ -865,6 +868,7 @@ function statusnet_fetchtimeline($a, $uid) {
                        $_SESSION["authenticated"] = true;
                        $_SESSION["uid"] = $uid;
 
+                       unset($_REQUEST);
                        $_REQUEST["type"] = "wall";
                        $_REQUEST["api_source"] = true;
                        $_REQUEST["profile_uid"] = $uid;
@@ -872,6 +876,8 @@ function statusnet_fetchtimeline($a, $uid) {
 
                        //$_REQUEST["date"] = $post->created_at;
 
+                       $_REQUEST["title"] = "";
+
                        $_REQUEST["body"] = $post->text;
                        if (is_string($post->place->name))
                                $_REQUEST["location"] = $post->place->name;
old mode 100755 (executable)
new mode 100644 (file)
index 73d2d77..795a7cd
Binary files a/twitter.tgz and b/twitter.tgz differ
index 1b9f2c1b06961c53cc0019a83066915671635b13..7dd083eaafc910364109bbc57978efdb0b56123c 100755 (executable)
@@ -357,10 +357,10 @@ function twitter_shortenmsg($b) {
        $body = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', "\n", $body);
 
        // remove the share element
-       $body = preg_replace("/\[share(.*?)\](.*?)\[\/share\]/ism","\n\n$2\n\n",$body);
+       //$body = preg_replace("/\[share(.*?)\](.*?)\[\/share\]/ism","\n\n$2\n\n",$body);
 
        // At first convert the text to html
-       $html = bbcode($body, false, false);
+       $html = bbcode($body, false, false, 2);
 
        // Then convert it to plain text
        //$msg = trim($b['title']." \n\n".html2plain($html, 0, true));
@@ -392,6 +392,21 @@ function twitter_shortenmsg($b) {
        // If there is no bookmark element then take the first link
        if ($link == '') {
                $links = collecturls($html);
+
+               foreach($links AS $singlelink) {
+                       $img_str = fetch_url($singlelink);
+
+                       $tempfile = tempnam(get_config("system","temppath"), "cache");
+                       file_put_contents($tempfile, $img_str);
+                       $mime = image_type_to_mime_type(exif_imagetype($tempfile));
+                       unlink($tempfile);
+
+                       if (substr($mime, 0, 6) == "image/") {
+                               $image = $singlelink;
+                               unset($links[$singlelink]);
+                       }
+               }
+
                if (sizeof($links) > 0) {
                        reset($links);
                        $link = current($links);
@@ -414,12 +429,16 @@ function twitter_shortenmsg($b) {
 
        // If the message is short enough then don't modify it.
        if ((strlen(trim($origmsg)) <= $max_char) AND ($msglink == ""))
-               return(trim($origmsg));
+               return(array("msg"=>trim($origmsg), "image"=>""));
+
+       // If the message is short enough and contains a picture then post the picture as well
+       if ((strlen(trim($origmsg)) <= ($max_char - 20)) AND strpos($origmsg, $msglink))
+               return(array("msg"=>trim($origmsg), "image"=>$image));
 
        // If the message is short enough and the link exists in the original message don't modify it as well
        // -3 because of the bad shortener of twitter
        if ((strlen(trim($origmsg)) <= ($max_char - 3)) AND strpos($origmsg, $msglink))
-               return(trim($origmsg));
+               return(array("msg"=>trim($origmsg), "image"=>""));
 
        // Preserve the unshortened link
        $orig_link = $msglink;
@@ -444,15 +463,45 @@ function twitter_shortenmsg($b) {
                        $msg = substr($msg, 0, $pos);
                else if ($lastchar != "\n")
                        $msg = substr($msg, 0, -3)."...";
+
+               // if the post contains a picture and a link then the system tries to cut the post earlier.
+               // So the link and the picture can be posted.
+               if (($image != "") AND ($orig_link != $image)) {
+                       $msg2 = substr($msg, 0, ($max_char - 20) - (strlen($msglink)));
+                       $lastchar = substr($msg2, -1);
+                       $msg2 = substr($msg2, 0, -1);
+                       $pos = strrpos($msg2, "\n");
+                       if ($pos > 0)
+                               $msg = substr($msg2, 0, $pos);
+                       else if ($lastchar == "\n")
+                               $msg = trim($msg2);
+               }
+
        }
-       $msg = str_replace("\n", " ", $msg);
+       //$msg = str_replace("\n", " ", $msg);
 
        // Removing multiple spaces - again
        while (strpos($msg, "  ") !== false)
                $msg = str_replace("  ", " ", $msg);
 
-       //return(trim($msg." ".$msglink));
-       return(trim($msg." ".$orig_link));
+       // Removing multiple newlines
+       //while (strpos($msg, "\n\n") !== false)
+       //      $msg = str_replace("\n\n", "\n", $msg);
+
+       // Looking if the link points to an image
+       $img_str = fetch_url($orig_link);
+
+       $tempfile = tempnam(get_config("system","temppath"), "cache");
+       file_put_contents($tempfile, $img_str);
+       $mime = image_type_to_mime_type(exif_imagetype($tempfile));
+       unlink($tempfile);
+
+       if (($image == $orig_link) OR (substr($mime, 0, 6) == "image/"))
+               return(array("msg"=>trim($msg), "image"=>$orig_link));
+       else if (($image != $orig_link) AND ($image != "") AND (strlen($msg."\n".$msglink) <= ($max_char - 20)))
+               return(array("msg"=>trim($msg."\n".$orig_link), "image"=>$image));
+       else
+               return(array("msg"=>trim($msg."\n".$orig_link), "image"=>""));
 }
 
 function twitter_post_hook(&$a,&$b) {
@@ -573,17 +622,39 @@ function twitter_post_hook(&$a,&$b) {
                        }
 
                        $msg = trim($msg);
-               } else
-                       $msg = twitter_shortenmsg($b);
-
+                       $image = "";
+               } else {
+                       $msgarr = twitter_shortenmsg($b);
+                        $msg = $msgarr["msg"];
+                        $image = $msgarr["image"];
+               }
                // and now tweet it :-)
-               if(strlen($msg)) {
-                       $result = $tweet->post('statuses/update', array('status' => $msg));
-                       logger('twitter_post send, result: ' . print_r($result, true), LOGGER_DEBUG);
+               if(strlen($msg) and ($image != "")) {
+                       $img_str = fetch_url($image);
+
+                       $tempfile = tempnam(get_config("system","temppath"), "cache");
+                       file_put_contents($tempfile, $img_str);
+                       $mime = image_type_to_mime_type(exif_imagetype($tempfile));
+                       unlink($tempfile);
+
+                       $filename = "upload";
+
+                       $result = $tweet->post('statuses/update_with_media', array('media[]' => "{$img_str};type=".$mime.";filename={$filename}" , 'status' => $msg));
+
+                       logger('twitter_post_with_media send, result: ' . print_r($result, true), LOGGER_DEBUG);
                        if ($result->error) {
                                logger('Send to Twitter failed: "' . $result->error . '"');
+                               // Workaround: Remove the picture link so that the post can be reposted without it
+                               $image = "";
                        }
                }
+
+               if(strlen($msg) and ($image == "")) {
+                       $result = $tweet->post('statuses/update', array('status' => $msg));
+                       logger('twitter_post send, result: ' . print_r($result, true), LOGGER_DEBUG);
+                       if ($result->error)
+                               logger('Send to Twitter failed: "' . $result->error . '"');
+               }
        }
 }
 
@@ -678,6 +749,7 @@ function twitter_fetchtimeline($a, $uid) {
                        $_SESSION["authenticated"] = true;
                        $_SESSION["uid"] = $uid;
 
+                       unset($_REQUEST);
                        $_REQUEST["type"] = "wall";
                        $_REQUEST["api_source"] = true;
                        $_REQUEST["profile_uid"] = $uid;
@@ -685,6 +757,8 @@ function twitter_fetchtimeline($a, $uid) {
 
                        //$_REQUEST["date"] = $post->created_at;
 
+                       $_REQUEST["title"] = "";
+
                        $_REQUEST["body"] = $post->text;
                        if (is_string($post->place->name))
                                $_REQUEST["location"] = $post->place->name;
index 404ea13424a62b5f5386aa2ef07ab601ec494d98..710221d8f391df80be5b5e4711fe7ab89e5c9db3 100755 (executable)
Binary files a/wppost.tgz and b/wppost.tgz differ
index e8b6fc6d5236235690b0a0ca0b9f6f16a5a13eb8..a6574cc2f8259bb8e81131fcbe337a1efec8a009 100755 (executable)
@@ -189,21 +189,30 @@ function wppost_send(&$a,&$b) {
 
                        // If no bookmark is found then take the first line
                        if ($wptitle == '') {
-                               $title = html2plain(bbcode($b['body']), 0, true);
+                               $title = html2plain(bbcode($b['body'], false, false), 0, true)."\n";
                                $pos = strpos($title, "\n");
-                               if (($pos == 0) or ($pos > 60))
-                                       $pos = 60;
+                               $trailer = "";
+                               if (($pos == 0) or ($pos > 100)) {
+                                       $pos = 100;
+                                       $trailer = "...";
+                               }
 
-                               $wptitle = substr($title, 0, $pos);
+                               $wptitle = substr($title, 0, $pos).$trailer;
                        }
                }
 
                $title = '<title>' . (($wptitle) ? $wptitle : t('Post from Friendica')) . '</title>';
-               $post = $title . bbcode($b['body']);
+               $post = bbcode($b['body'], false, false);
+
+               // If a link goes to youtube then remove the stuff around it. Wordpress detects youtube links and embeds it
+               $post = preg_replace('/<a.*?href="(https?:\/\/www.youtube.com\/.*?)".*?>(.*?)<\/a>/ism',"\n$1\n",$post);
+               $post = preg_replace('/<a.*?href="(https?:\/\/youtu.be\/.*?)".*?>(.*?)<\/a>/ism',"\n$1\n",$post);
+
+               $post = $title.$post;
 
                $wp_backlink = intval(get_pconfig($b['uid'],'wppost','backlink'));
                if($wp_backlink && $b['plink'])
-                       $post .= EOL . EOL . '<a href="' . $b['plink'] . '">' 
+                       $post .= EOL . EOL . '<a href="' . $b['plink'] . '">'
                                . t('Read the original post and comment stream on Friendica') . '</a>' . EOL . EOL;
 
                $post = xmlify($post);