}
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()));
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);
/* 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;
try {
// send request
- $answer_json = DI::httpRequest()->fetchUrl($url);
+ $answer_json = DI::httpRequest()->fetch($url);
// parse answer
$answer = json_decode($answer_json);
{
// 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'];
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
-use Friendica\Network\HTTPRequest;
use Friendica\Protocol\Activity;
function mailstream_install() {
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),
use Friendica\Core\Hook;
use Friendica\Core\Protocol;
use Friendica\DI;
-use Friendica\Network\HTTPRequest;
use Friendica\Util\Proxy as ProxyUtils;
function mastodoncustomemojis_install()
$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);
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']);
// 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']);
} 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']);
}
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];
} 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);
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);
} 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);