logger('blogger: data: ' . $xml, LOGGER_DATA);
if ($bl_blog !== 'test') {
- $x = Network::postURL($bl_blog, $xml);
+ $x = Network::post($bl_blog, $xml);
}
logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG);
//if ($includedlinks) {
// if (isset($post["url"]))
- // $post["url"] = Network::shortLink($post["url"]);
+ // $post["url"] = Network::shortenUrl($post["url"]);
// if (isset($post["image"]))
- // $post["image"] = Network::shortLink($post["image"]);
+ // $post["image"] = Network::shortenUrl($post["image"]);
// if (isset($post["preview"]))
- // $post["preview"] = Network::shortLink($post["preview"]);
+ // $post["preview"] = Network::shortenUrl($post["preview"]);
//}
// Seems like a bug to me
}
}
try {
- $res = new SimpleXMLElement(Network::fetchURL($url));
+ $res = new SimpleXMLElement(Network::fetchUrl($url));
} catch (Exception $e) {
info(L10n::t('Error fetching weather data.\nError was: '.$e->getMessage()));
return false;
logger('dwpost: data: ' . $xml, LOGGER_DATA);
if($dw_blog !== 'test') {
- $x = Network::postURL($dw_blog, $xml, ["Content-Type: text/xml"]);
+ $x = Network::post($dw_blog, $xml, ["Content-Type: text/xml"]);
}
logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG);
}
. $a->get_baseurl() . '/addon/fortunate/fortunate.css' . '" media="all" />' . "\r\n";
if (FORTUNATE_SERVER != 'hostname.com') {
- $s = Network::fetchURL('http://' . FORTUNATE_SERVER . '/cookie.php?numlines=2&equal=1&rand=' . mt_rand());
+ $s = Network::fetchUrl('http://' . FORTUNATE_SERVER . '/cookie.php?numlines=2&equal=1&rand=' . mt_rand());
$b .= '<div class="fortunate">' . $s . '</div>';
}
}
switch($attachment->objectType) {
case "video":
$pagedata["type"] = "video";
- $pagedata["url"] = Network::originalURL($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
break;
case "article":
$pagedata["type"] = "link";
- $pagedata["url"] = Network::originalURL($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
break;
case "photo-album":
- $pagedata["url"] = Network::originalURL($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$post .= "\n\n[bookmark=".$pagedata["url"]."]".$pagedata["title"]."[/bookmark]\n";
case "album":
$pagedata["type"] = "link";
- $pagedata["url"] = Network::originalURL($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$thumb = $attachment->thumbnails[0];
break;
case "audio":
- $pagedata["url"] = Network::originalURL($attachment->url);
+ $pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$post .= "\n\n[bookmark=".$pagedata["url"]."]".$pagedata["title"]."[/bookmark]\n";
break;
$account = PConfig::get($uid,'fromgplus','account');
$key = Config::get('fromgplus','key');
- $result = Network::fetchURL("https://www.googleapis.com/plus/v1/people/".$account."/activities/public?alt=json&pp=1&key=".$key."&maxResults=".$maxfetch);
+ $result = Network::fetchUrl("https://www.googleapis.com/plus/v1/people/".$account."/activities/public?alt=json&pp=1&key=".$key."&maxResults=".$maxfetch);
//$result = file_get_contents("google.txt");
//file_put_contents("google.txt", $result);
return;
}
- $s = Network::fetchURL("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language);
+ $s = Network::fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language);
if (!$s) {
logger("API could not be queried", LOGGER_DEBUG);
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Util\Network;
+use Friendica\Util\XML;
function geonames_install() {
*
*/
- $s = Network::fetchURL('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
+ $s = Network::fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
if(! $s)
return;
- $xml = Network::parseXmlString($s);
+ $xml = XML::parseString($s);
if($xml->geoname->name && $xml->geoname->countryName)
$item['location'] = $xml->geoname->name . ', ' . $xml->geoname->countryName;
logger('ijpost: data: ' . $xml, LOGGER_DATA);
if($ij_blog !== 'test') {
- $x = Network::postURL($ij_blog, $xml, ["Content-Type: text/xml"]);
+ $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"]);
}
logger('posted to insanejournal: ' . ($x) ? $x : '', LOGGER_DEBUG);
try {
// send request
- $answer_json = Network::fetchURL($url);
+ $answer_json = Network::fetchUrl($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 = Network::fetchURL($url);
+ $sitelist = Network::fetchUrl($url);
$siteurls = explode(',', $sitelist);
$whitelist = ['tagesschau.de', 'heute.de', 'wdr.de'];
$url = "http://www.vg-media.de/lizenzen/digitale-verlegerische-angebote/wahrnehmungsberechtigte-digitale-verlegerische-angebote.html";
- $site = Network::fetchURL($url);
+ $site = Network::fetchUrl($url);
$doc = new DOMDocument();
@$doc->loadHTML($site);
// 'token' => $ltree_api_token
];
- $result = Network::postURL($ltree_blog, $params);
+ $result = Network::post($ltree_blog, $params);
logger('libertree: ' . $result);
}
}
logger('ljpost: data: ' . $xml, LOGGER_DATA);
if ($lj_blog !== 'test') {
- $x = Network::postURL($lj_blog, $xml, ["Content-Type: text/xml"]);
+ $x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"]);
}
logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG);
}
$redirects;
$cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-');
$attachments[$url] = [
- 'data' => Network::fetchURL($url, true, $redirects, 0, null, $cookiejar),
+ 'data' => Network::fetchUrl($url, true, $redirects, 0, null, $cookiejar),
'guid' => hash("crc32", $url),
'filename' => basename($url),
'type' => $a->get_curl_content_type()];
$nomserver = 'http://nominatim.openstreetmap.org/search.php';
$args = '?q=' . urlencode($b['location']) . '&format=json';
- $x = Network::zFetchURL($nomserver . $args);
+ $x = Network::curl($nomserver . $args);
if($x['success']) {
$j = json_decode($x['body'],true);
function pumpio_reachable($url) {
- $data = Network::zFetchURL($url, false, $redirects, ['timeout'=>10]);
+ $data = Network::curl($url, false, $redirects, ['timeout'=>10]);
return(intval($data['return_code']) != 0);
}
foreach ($globalsn as $asn) {
if ($asn['apiurl'] == $_POST['statusnet-preconf-apiurl']) {
$apibase = $asn['apiurl'];
- $c = Network::fetchURL($apibase . 'statusnet/version.xml');
+ $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
PConfig::set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']);
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 = Network::fetchURL($apibase . 'statusnet/version.xml');
+ $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
// ok the API path is correct, let's save the settings
PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
} else {
// the API path is not correct, maybe missing trailing / ?
$apibase = $apibase . '/';
- $c = Network::fetchURL($apibase . 'statusnet/version.xml');
+ $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
// ok the API path is now correct, let's save the settings
PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
if ((strlen($msgarr["url"]) > 20) &&
((strlen($msg . " \n" . $msgarr["url"]) > $max_char))) {
- $msg .= " \n" . Network::shortLink($msgarr["url"]);
+ $msg .= " \n" . Network::shortenUrl($msgarr["url"]);
} else {
$msg .= " \n" . $msgarr["url"];
}
}
if ($image != "") {
- $img_str = Network::fetchURL($image);
+ $img_str = Network::fetchUrl($image);
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);
$postdata = ["status" => $msg, "media[]" => $tempfile];
logger("statusnet_convertmsg: expanding url " . $match[1], LOGGER_DEBUG);
- $expanded_url = Network::originalURL($match[1]);
+ $expanded_url = Network::finalUrl($match[1]);
logger("statusnet_convertmsg: fetching data for " . $expanded_url, LOGGER_DEBUG);
} elseif ($oembed_data->type != "link") {
$body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body);
} else {
- $img_str = Network::fetchURL($expanded_url, true, $redirects, 4);
+ $img_str = Network::fetchUrl($expanded_url, true, $redirects, 4);
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);
// and now tweet it :-)
if (strlen($msg) && ($image != "")) {
- $img_str = Network::fetchURL($image);
+ $img_str = Network::fetchUrl($image);
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);
$plain = str_replace($url->url, '', $plain);
if ($url->url && $url->expanded_url && $url->display_url) {
- $expanded_url = Network::originalURL($url->expanded_url);
+ $expanded_url = Network::finalUrl($url->expanded_url);
$oembed_data = OEmbed::fetchURL($expanded_url);
} elseif ($oembed_data->type != "link") {
$body = str_replace($url->url, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body);
} else {
- $img_str = Network::fetchURL($expanded_url, true, $redirects, 4);
+ $img_str = Network::fetchUrl($expanded_url, true, $redirects, 4);
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);
logger('wppost: data: ' . $xml, LOGGER_DATA);
if ($wp_blog !== 'test') {
- $x = Network::postURL($wp_blog, $xml);
+ $x = Network::post($wp_blog, $xml);
}
logger('posted to wordpress: ' . (($x) ? $x : ''), LOGGER_DEBUG);
}