logger('blogger: data: ' . $xml, LOGGER_DATA);
if ($bl_blog !== 'test') {
- $x = Network::post($bl_blog, $xml);
+ $x = Network::post($bl_blog, $xml)->getBody();
}
logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG);
logger('dwpost: data: ' . $xml, LOGGER_DATA);
if ($dw_blog !== 'test') {
- $x = Network::post($dw_blog, $xml, ["Content-Type: text/xml"]);
+ $x = Network::post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody();
}
logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG);
logger('ijpost: data: ' . $xml, LOGGER_DATA);
if ($ij_blog !== 'test') {
- $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"]);
+ $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody();
}
logger('posted to insanejournal: ' . $x ? $x : '', LOGGER_DEBUG);
}
// 'token' => $ltree_api_token
];
- $result = Network::post($ltree_blog, $params);
+ $result = Network::post($ltree_blog, $params)->getBody();
logger('libertree: ' . $result);
}
}
logger('ljpost: data: ' . $xml, LOGGER_DATA);
if ($lj_blog !== 'test') {
- $x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"]);
+ $x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody();
}
logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG);
}
$api_url = $api_base_url . '/api/v1/custom_emojis';
- $ret = Network::fetchUrlFull($api_url);
+ $fetchResult = Network::fetchUrlFull($api_url);
- if ($ret['success']) {
- $emojis_array = json_decode($ret['body'], true);
+ if ($fetchResult->isSuccess()) {
+ $emojis_array = json_decode($fetchResult->getBody(), true);
if (is_array($emojis_array) && count($emojis_array)) {
foreach ($emojis_array as $emoji) {
$j = Cache::get($cachekey);
if (is_null($j)) {
- $x = Network::curl($nomserver . $args);
- if ($x['success']) {
- $j = json_decode($x['body'], true);
+ $curlResult = Network::curl($nomserver . $args);
+ if ($curlResult->isSuccess()) {
+ $j = json_decode($curlResult->getBody(), true);
Cache::set($cachekey, $j, CACHE_MONTH);
}
}
function pumpio_reachable($url)
{
- $data = Network::curl($url, false, $redirects, ['timeout'=>10]);
- return intval($data['return_code']) != 0;
+ return Network::curl($url, false, $redirects, ['timeout'=>10])->isSuccess();
}
/*
logger('wppost: data: ' . $xml, LOGGER_DATA);
if ($wp_blog !== 'test') {
- $x = Network::post($wp_blog, $xml);
+ $x = Network::post($wp_blog, $xml)->getBody();
}
logger('posted to wordpress: ' . (($x) ? $x : ''), LOGGER_DEBUG);
}