require 'addon/buffer/bufferapp.php';
use Friendica\App;
+use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
if($access_token) {
$buffer = new BufferApp($client_id, $client_secret, $callback_url, $access_token);
- require_once("include/plaintext.php");
- require_once("include/network.php");
+ require_once 'include/network.php';
$profiles = $buffer->go('/profiles');
if (is_array($profiles)) {
$item["body"] = preg_replace("(\[s\](.*?)\[\/s\])ism",'-$1-',$item["body"]);
}
- $post = plaintext($item, $limit, $includedlinks, $htmlmode);
+ $post = Plaintext::toPlaintext($item, $limit, $includedlinks, $htmlmode);
logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG);
// The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures
if (($profile->service == "twitter") && isset($post["url"]) && ($post["type"] != "photo"))
$post["text"] .= " ".$post["url"];
elseif (($profile->service == "appdotnet") && isset($post["url"]) && isset($post["title"]) && ($post["type"] != "photo")) {
- $post["title"] = shortenmsg($post["title"], 90);
- $post["text"] = shortenmsg($post["text"], $limit - (24 + strlen($post["title"])));
+ $post["title"] = Plaintext::shortenMsg($post["title"], 90);
+ $post["text"] = Plaintext::shortenMsg($post["text"], $limit - (24 + strlen($post["title"])));
$post["text"] .= "\n[".$post["title"]."](".$post["url"].")";
} elseif (($profile->service == "appdotnet") && isset($post["url"]) && ($post["type"] != "photo"))
$post["text"] .= " ".$post["url"];
use Friendica\App;
use Friendica\Content\OEmbed;
+use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
PConfig::set($b['uid'], 'statusnet', 'max_char', $max_char);
$tempfile = "";
- require_once "include/plaintext.php";
require_once "include/network.php";
- $msgarr = plaintext($b, $max_char, true, 7);
+ $msgarr = Plaintext::toPlaintext($b, $max_char, true, 7);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"]))
- $msg = shortenmsg($msgarr["title"], $max_char - 50);
+ $msg = Plaintext::shortenMsg($msgarr["title"], $max_char - 50);
$image = "";
$max_char = 140;
}
- require_once "include/plaintext.php";
$item = $b["item"];
$item["plink"] = $a->get_baseurl() . "/display/" . $a->user["nickname"] . "/" . $item["parent"];
}
}
- $msgarr = plaintext($item, $max_char, true, 7);
+ $msgarr = Plaintext::toPlaintext($item, $max_char, true, 7);
$msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
require_once 'library/OAuth1.php';
require_once 'addon/tumblr/tumblroauth/tumblroauth.php';
+use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
$tags = implode(',',$tag_arr);
$title = trim($b['title']);
- require_once('include/plaintext.php');
- $siteinfo = get_attached_data($b["body"]);
+ $siteinfo = Plaintext::getAttachedData($b["body"]);
$params = [
'state' => 'published',
use Friendica\App;
use Friendica\Content\OEmbed;
+use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
$tweet = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
$max_char = 280;
- require_once "include/plaintext.php";
- $msgarr = plaintext($b, $max_char, true, 8);
+ $msgarr = Plaintext::toPlaintext($b, $max_char, true, 8);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) {
- $msg = shortenmsg($msgarr["title"], $max_char - 50);
+ $msg = Plaintext::shortenMsg($msgarr["title"], $max_char - 50);
}
$image = "";
if (strlen($msg) && ($image == "")) {
// -----------------
$max_char = 280;
- require_once "include/plaintext.php";
- $msgarr = plaintext($b, $max_char, true, 8);
+ $msgarr = Plaintext::toPlaintext($b, $max_char, true, 8);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) {
- $msg = shortenmsg($msgarr["title"], $max_char - 50);
+ $msg = Plaintext::shortenMsg($msgarr["title"], $max_char - 50);
}
if (isset($msgarr["url"])) {
if ($b["preview"]) {
$max_char = 280;
- require_once "include/plaintext.php";
$item = $b["item"];
$item["plink"] = $a->get_baseurl() . "/display/" . $a->user["nickname"] . "/" . $item["parent"];
}
}
- $msgarr = plaintext($item, $max_char, true, 8);
+ $msgarr = Plaintext::toPlaintext($item, $max_char, true, 8);
$msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
* Version: 1.1
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*/
+use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
$wp_backlink_text = L10n::t('Read the original post and comment stream on Friendica');
}
- if($wp_username && $wp_password && $wp_blog) {
-
- require_once('include/bbcode.php');
- require_once('include/html2plain.php');
- require_once('include/plaintext.php');
+ if ($wp_username && $wp_password && $wp_blog) {
+ require_once 'include/bbcode.php';
+ require_once 'include/html2plain.php';
$wptitle = trim($b['title']);
- if (intval(PConfig::get($b['uid'],'wppost','shortcheck'))) {
+ if (intval(PConfig::get($b['uid'], 'wppost', 'shortcheck'))) {
// Checking, if its a post that is worth a blog post
$postentry = false;
- $siteinfo = get_attached_data($b["body"]);
+ $siteinfo = Plaintext::getAttachedData($b["body"]);
// Is it a link to an aricle, a video or a photo?
if (isset($siteinfo["type"])) {
// If the title is empty then try to guess
if ($wptitle == '') {
// Fetch information about the post
- $siteinfo = get_attached_data($b["body"]);
+ $siteinfo = Plaintext::getAttachedData($b["body"]);
if (isset($siteinfo["title"])) {
$wptitle = $siteinfo["title"];
}