public function request($cmd) { $url = "http://" . $this->_address . $cmd; $curl = new NetworkRequest(); $curl->set($url, array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERPWD => $this->_authentication)); $result = $curl->execute(); $curl->close(); }
public function request($cmd, $params) { $url = "https://prowl.weks.net/publicapi/" . $cmd; $curl = new NetworkRequest(); $curl->set($url, array(CURLOPT_USERAGENT => "nzbVR-" . nzbVR::VERSION, CURLOPT_HTTPAUTH => CURLAUTH_ANY, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FRESH_CONNECT => TRUE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $params)); $result = $curl->execute(); $curl->close(); }
public function request($cmd) { $url = "http://{$this->_address}/api/{$cmd}"; $username = base64_decode(nzbVR::instance()->settings->sabnzbd_username); $password = base64_decode(nzbVR::instance()->settings->sabnzbd_password); if ($username != null && $password != null) { $url .= "&ma_username={$username}&ma_password={$password}"; } $curl = new NetworkRequest(); $curl->set($url, array(CURLOPT_RETURNTRANSFER => 1)); $result = $curl->execute(); $curl->close(); }
function _xNetworkStatsGet() { require_once 'network-util.php'; require_once 'textdb.php'; $db = new NetworkDB(); $site = $db->Retrieve($_REQUEST['domain']); if (empty($site)) { network_stats_cache_remove($_REQUEST['domain']); return JSON::Warning(array('response' => 'Site no longer exists in the database')); } // Get stats for a network site $nr = new NetworkRequest($site, NETWORK_FNC_GET_STATS); if (($response = $nr->Execute()) === false) { network_stats_cache_remove($_REQUEST['domain']); return JSON::Warning(array('response' => $nr->error)); } network_stats_cache_update($site, $response); JSON::Success(array('response' => unserialize($response))); }