From 6a3b76f11734fd04fd9be19b7c8bed2b32786f73 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Wed, 4 Mar 2020 22:35:39 +0100 Subject: [PATCH] Rename "fetchUrl" and "fetchUrlFull" to "fetch" and "fetchFull" --- curweather/curweather.php | 2 +- geocoordinates/geocoordinates.php | 2 +- geonames/geonames.php | 2 +- jappixmini/jappixmini.php | 2 +- leistungsschutzrecht/leistungsschutzrecht.php | 2 +- mailstream/mailstream.php | 2 +- mastodoncustomemojis/mastodoncustomemojis.php | 2 +- statusnet/statusnet.php | 10 +++++----- twitter/twitter.php | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/curweather/curweather.php b/curweather/curweather.php index ef75637e..1592334c 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -50,7 +50,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())); diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index ee267744..08146af9 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -53,7 +53,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); diff --git a/geonames/geonames.php b/geonames/geonames.php index 41a96778..0394c673 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -79,7 +79,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; diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 4f655a01..65f12e98 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -661,7 +661,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); diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index d5c23c67..365200a0 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -80,7 +80,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']; diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 54b48dbd..4f31b92f 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -170,7 +170,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), diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index 10056449..ff3c27e7 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -91,7 +91,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); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 13459ca3..de6c27e9 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -155,7 +155,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']); @@ -173,7 +173,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']); @@ -183,7 +183,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']); @@ -613,7 +613,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]; @@ -1476,7 +1476,7 @@ function statusnet_convertmsg(App $a, $body, $no_tags = false) } 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); diff --git a/twitter/twitter.php b/twitter/twitter.php index dde39a7a..ef5538a2 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -656,7 +656,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); @@ -1202,7 +1202,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture) } elseif ($oembed_data->type != 'link') { $body = str_replace($url->url, '[url=' . $expanded_url . ']' . $url->display_url . '[/url]', $body); } 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);