]> git.mxchange.org Git - friendica-addons.git/commitdiff
[various] Replace *_page_info function calls with Content\PageInfo equivalent
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 14 Jul 2020 14:17:17 +0000 (10:17 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 14 Jul 2020 14:17:17 +0000 (10:17 -0400)
ifttt/ifttt.php
statusnet/statusnet.php
twitter/twitter.php

index 45ba2bf9a020a9cfc3cd61c7d3ea3203393ef8f8..6ecfc160a46452f6314cc97c29c49d488e3d8415 100644 (file)
@@ -8,6 +8,7 @@
  */
 require_once 'mod/item.php';
 use Friendica\App;
+use Friendica\Content\PageInfo;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
@@ -185,7 +186,7 @@ function ifttt_message($uid, $item)
        }
 
        if ($item['type'] == 'link') {
-               $data = query_page_info($item['link']);
+               $data = PageInfo::queryUrl($item['link']);
 
                if (isset($item['title']) && (trim($item['title']) != '')) {
                        $data['title'] = $item['title'];
@@ -195,7 +196,7 @@ function ifttt_message($uid, $item)
                        $data['text'] = $item['description'];
                }
 
-               $_REQUEST['body'] .= add_page_info_data($data);
+               $_REQUEST['body'] .= "\n" . PageInfo::getFooterFromData($data);
        } elseif (($item['type'] == 'photo') && ($item['image'] != '')) {
                $_REQUEST['body'] .= "\n\n[img]" . $item['image'] . "[/img]\n";
        }
index f75d23460ac8679d3c04d89f0d0587371fd88f3d..f5bb7f42a12d9bc00958684893e0ff944dc5834f 100644 (file)
@@ -40,6 +40,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . '
 use CodebirdSN\CodebirdSN;
 use Friendica\App;
 use Friendica\Content\OEmbed;
+use Friendica\Content\PageInfo;
 use Friendica\Content\Text\HTML;
 use Friendica\Content\Text\Plaintext;
 use Friendica\Core\Hook;
@@ -896,7 +897,7 @@ function statusnet_fetchtimeline(App $a, $uid)
 
                                $_REQUEST["title"] = "";
 
-                               $_REQUEST["body"] = add_page_info_to_body($post->text, true);
+                               $_REQUEST["body"] = PageInfo::appendToBody($post->text, true);
                                if (is_string($post->place->name)) {
                                        $_REQUEST["location"] = $post->place->name;
                                }
@@ -1494,7 +1495,7 @@ function statusnet_convertmsg(App $a, $body)
                }
 
                if ($footerurl != "") {
-                       $footer = add_page_info($footerurl);
+                       $footer = "\n" . PageInfo::getFooterFromUrl($footerurl);
                }
 
                if (($footerlink != "") && (trim($footer) != "")) {
index 4c9701d844a3bfdfdd0bd6f34f1b55fd4dae518d..4139bdb93a4bb0c2dff55d5538784eb0f271fada 100644 (file)
@@ -67,6 +67,7 @@ use Abraham\TwitterOAuth\TwitterOAuthException;
 use Codebird\Codebird;
 use Friendica\App;
 use Friendica\Content\OEmbed;
+use Friendica\Content\PageInfo;
 use Friendica\Content\Text\BBCode;
 use Friendica\Content\Text\Plaintext;
 use Friendica\Core\Hook;
@@ -1356,7 +1357,7 @@ function twitter_expand_entities($body, stdClass $status, $picture)
        if (empty($status->quoted_status)) {
                $footer = '';
                if ($attachmentUrl) {
-                       $footer = add_page_info($attachmentUrl, false, $picture);
+                       $footer = "\n" . PageInfo::getFooterFromUrl($attachmentUrl, false, $picture);
                }
 
                if (trim($footer)) {
@@ -1364,7 +1365,7 @@ function twitter_expand_entities($body, stdClass $status, $picture)
                } elseif ($picture) {
                        $body .= "\n\n[img]" . $picture . "[/img]\n";
                } else {
-                       $body = add_page_info_to_body($body);
+                       $body = PageInfo::appendToBody($body);
                }
        }