]> git.mxchange.org Git - friendica-addons.git/commitdiff
Rename "fetchUrl" and "fetchUrlFull" to "fetch" and "fetchFull"
authornupplaPhil <admin+github@philipp.info>
Wed, 4 Mar 2020 21:35:39 +0000 (22:35 +0100)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 21 Jul 2020 07:32:23 +0000 (03:32 -0400)
curweather/curweather.php
geocoordinates/geocoordinates.php
geonames/geonames.php
jappixmini/jappixmini.php
leistungsschutzrecht/leistungsschutzrecht.php
mailstream/mailstream.php
mastodoncustomemojis/mastodoncustomemojis.php
statusnet/statusnet.php
twitter/twitter.php

index 7757dba7e42debba013da3f76fe13ebfd91af3fc..575c5503a3a9a64cc9afb8237d28253d17430822 100644 (file)
@@ -48,7 +48,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
        }
 
        try {
-               $res = new SimpleXMLElement(DI::httpRequest()->fetchUrl($url));
+               $res = new SimpleXMLElement(DI::httpRequest()->fetch($url));
        } catch (Exception $e) {
                if (empty($_SESSION['curweather_notice_shown'])) {
                        info(DI::l10n()->t('Error fetching weather data. Error was: '.$e->getMessage()));
index 8641d22366dc00e4ff1a327fc160b486ceb78475..2bde405caa94df868b2fc890613f40c5b487cced 100644 (file)
@@ -52,7 +52,7 @@ function geocoordinates_resolve_item(&$item)
                return;
        }
 
-       $s = DI::httpRequest()->fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=" . $coords[0] . "," . $coords[1] . "&key=" . $key . "&language=" . $language);
+       $s = DI::httpRequest()->fetch("https://api.opencagedata.com/geocode/v1/json?q=" . $coords[0] . "," . $coords[1] . "&key=" . $key . "&language=" . $language);
 
        if (!$s) {
                Logger::log("API could not be queried", Logger::DEBUG);
index 28d716b5e3683b23abe57638d71634a3490a1c1e..6536f9efae706dd11e0cf84b1aaba59e77b4397a 100644 (file)
@@ -77,7 +77,7 @@ function geonames_post_hook(App $a, array &$item)
 
        /* OK, we're allowed to do our stuff. */
 
-       $s = DI::httpRequest()->fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
+       $s = DI::httpRequest()->fetch('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
 
        if (!$s) {
                return;
index 52ae56d071cf73eb15318e8ad5ab954b56c01497..384b7798c86ae771adbdf71dc916c6f7708beea6 100644 (file)
@@ -659,7 +659,7 @@ function jappixmini_cron(App $a, $d)
 
                        try {
                                // send request
-                               $answer_json = DI::httpRequest()->fetchUrl($url);
+                               $answer_json = DI::httpRequest()->fetch($url);
 
                                // parse answer
                                $answer = json_decode($answer_json);
index 9bd1a68d0064191261b4b88e5375c733ba2cd2ef..eb25f550b554695cdc875a8155dbef9e98260426 100644 (file)
@@ -79,7 +79,7 @@ function leistungsschutzrecht_fetchsites()
 {
        // This list works - but question is how current it is
        $url = "http://leistungsschutzrecht-stoppen.d-64.org/blacklist.txt";
-       $sitelist = DI::httpRequest()->fetchUrl($url);
+       $sitelist = DI::httpRequest()->fetch($url);
        $siteurls = explode(',', $sitelist);
 
        $whitelist = ['tagesschau.de', 'heute.de', 'wdr.de'];
index 4eaa5704c24d8e616733981dfc1266b43c7a340d..d09f913a16321387a2f30da21b13f07c710e0c7a 100644 (file)
@@ -13,7 +13,6 @@ use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Item;
-use Friendica\Network\HTTPRequest;
 use Friendica\Protocol\Activity;
 
 function mailstream_install() {
@@ -169,7 +168,7 @@ function mailstream_do_images($a, &$item, &$attachments) {
                        continue;
                }
                $cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-');
-               $curlResult = DI::httpRequest()->fetchUrlFull($url, true, 0, '', $cookiejar);
+               $curlResult = DI::httpRequest()->fetchFull($url, true, 0, '', $cookiejar);
                $attachments[$url] = [
                        'data' => $curlResult->getBody(),
                        'guid' => hash("crc32", $url),
index 537cf46e383f20cb0a4b4b1d18c5753abd06e611..a3cd0b97aa817b69cb7fa01cf14fd7b0b26024ef 100644 (file)
@@ -15,7 +15,6 @@ use Friendica\Core\Cache\Duration;
 use Friendica\Core\Hook;
 use Friendica\Core\Protocol;
 use Friendica\DI;
-use Friendica\Network\HTTPRequest;
 use Friendica\Util\Proxy as ProxyUtils;
 
 function mastodoncustomemojis_install()
@@ -90,7 +89,7 @@ function mastodoncustomemojis_fetch_custom_emojis_for_url($api_base_url)
 
        $api_url = $api_base_url . '/api/v1/custom_emojis';
 
-       $fetchResult = DI::httpRequest()->fetchUrlFull($api_url);
+       $fetchResult = DI::httpRequest()->fetchFull($api_url);
 
        if ($fetchResult->isSuccess()) {
                $emojis_array = json_decode($fetchResult->getBody(), true);
index 7ec3a2d5dbbe09f1dad3943aee14c06a0e7bd7ff..c213a4c37f10c38eaefc681ead21dc1c4e71d119 100644 (file)
@@ -154,7 +154,7 @@ function statusnet_settings_post(App $a, $post)
                        foreach ($globalsn as $asn) {
                                if ($asn['apiurl'] == $_POST['statusnet-preconf-apiurl']) {
                                        $apibase = $asn['apiurl'];
-                                       $c = DI::httpRequest()->fetchUrl($apibase . 'statusnet/version.xml');
+                                       $c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml');
                                        if (strlen($c) > 0) {
                                                DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']);
                                                DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']);
@@ -172,7 +172,7 @@ function statusnet_settings_post(App $a, $post)
                                //  we'll check the API Version for that, if we don't get one we'll try to fix the path but will
                                //  resign quickly after this one try to fix the path ;-)
                                $apibase = $_POST['statusnet-baseapi'];
-                               $c = DI::httpRequest()->fetchUrl($apibase . 'statusnet/version.xml');
+                               $c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml');
                                if (strlen($c) > 0) {
                                        //  ok the API path is correct, let's save the settings
                                        DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
@@ -182,7 +182,7 @@ function statusnet_settings_post(App $a, $post)
                                } else {
                                        //  the API path is not correct, maybe missing trailing / ?
                                        $apibase = $apibase . '/';
-                                       $c = DI::httpRequest()->fetchUrl($apibase . 'statusnet/version.xml');
+                                       $c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml');
                                        if (strlen($c) > 0) {
                                                //  ok the API path is now correct, let's save the settings
                                                DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
@@ -612,7 +612,7 @@ function statusnet_post_hook(App $a, &$b)
                }
 
                if ($image != "") {
-                       $img_str = DI::httpRequest()->fetchUrl($image);
+                       $img_str = DI::httpRequest()->fetch($image);
                        $tempfile = tempnam(get_temppath(), "cache");
                        file_put_contents($tempfile, $img_str);
                        $postdata = ["status" => $msg, "media[]" => $tempfile];
@@ -1473,7 +1473,7 @@ function statusnet_convertmsg(App $a, $body)
                        } elseif ($oembed_data->type != "link") {
                                $body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body);
                        } else {
-                               $img_str = DI::httpRequest()->fetchUrl($expanded_url, true, 4);
+                               $img_str = DI::httpRequest()->fetch($expanded_url, true, 4);
 
                                $tempfile = tempnam(get_temppath(), "cache");
                                file_put_contents($tempfile, $img_str);
index 30195427d9eab23e7cb4f64efabf96435ce67513..7d9cbfda2a2cd867004811f72e9ffcdeec2e798b 100644 (file)
@@ -673,7 +673,7 @@ function twitter_post_hook(App $a, array &$b)
                                                continue;
                                        }
 
-                                       $img_str = DI::httpRequest()->fetchUrl($image['url']);
+                                       $img_str = DI::httpRequest()->fetch($image['url']);
 
                                        $tempfile = tempnam(get_temppath(), 'cache');
                                        file_put_contents($tempfile, $img_str);
@@ -1317,7 +1317,7 @@ function twitter_expand_entities($body, stdClass $status, $picture)
                        } elseif ($oembed_data->type != 'link') {
                                $replace = '[url=' . $expanded_url . ']' . $url->display_url . '[/url]';
                        } else {
-                               $img_str = DI::httpRequest()->fetchUrl($final_url, true, 4);
+                               $img_str = DI::httpRequest()->fetch($final_url, true, 4);
 
                                $tempfile = tempnam(get_temppath(), 'cache');
                                file_put_contents($tempfile, $img_str);