It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
require 'faucetbox.php';
$api_key = "YOUR_API_KEY";
$currency = "BTC"; # or LTC or any other supported by FaucetBOX
$faucetbox = new FaucetBOX($api_key, $currency);
# To send 500 satoshi to address
$result = $faucetbox->send("1asdbitcoinaddressheredsa", 500);
if($result["success"] === true) { # you can check if it was successful
echo $result["html"]; # there's example html ready for you
} else { # something went wrong :(
log_error($result["response"]); # you can log whole response from server
echo $result["html"]; # and display error message to user
}
?>
$api_key = "Dp*************uc";
$currency = "BTC"; # or LTC or any other supported by FaucetBOX
$faucetbox = new FaucetBOX($api_key, $currency);
# To send 500 satoshi to address
$result = $faucetbox->send("1Le*********3FUf", 500);
if($result["success"] === true) { # you can check if it was successful
echo $result["html"]; # there's example html ready for you
} else { # something went wrong :(
log_error($result["response"]); # you can log whole response from server
echo $result["html"]; # and display error message to user
}
?>
Fatal error: Class 'FaucetBOX' not found in /home/u650662239/public_html/in.php on line 4
$api_key = "YOUR_API_KEY";
$currency = "BTC"; # or LTC or any other supported by FaucetBOX
$faucetbox = new FaucetBOX($api_key, $currency);
# To send 500 satoshi to address
$result = $faucetbox->send("1asdbitcoinaddressheredsa", 500);
if($result["success"] === true) { # you can check if it was successful
echo $result["html"]; # there's example html ready for you
} else { # something went wrong :(
log_error($result["response"]); # you can log whole response from server
echo $result["html"]; # and display error message to user
}
?>
class FaucetBOX
{
protected $api_key;
protected $currency;
public $last_status = null;
protected $api_base = "https://faucetbox.com/api/v1/";
public function __construct($api_key, $currency = "BTC", $disable_curl = false, $verify_peer = true) {
$this->api_key = $api_key;
$this->currency = $currency;
$this->disable_curl = $disable_curl;
$this->verify_peer = $verify_peer;
$this->curl_warning = false;
}
public function __execPHP($method, $params = array()) {
$params = array_merge($params, array("api_key" => $this->api_key, "currency" => $this->currency));
$opts = array(
"http" => array(
"method" => "POST",
"header" => "Content-type: application/x-www-form-urlencoded\r\n",
"content" => http_build_query($params)
),
"ssl" => array(
"verify_peer" => $this->verify_peer
)
);
$ctx = stream_context_create($opts);
$fp = fopen($this->api_base . $method, 'rb', null, $ctx);
$response = stream_get_contents($fp);
if($response && !$this->disable_curl) {
$this->curl_warning = true;
}
fclose($fp);
return $response;
}
public function __exec($method, $params = array()) {
$this->last_status = null;
if($this->disable_curl) {
$response = $this->__execPHP($method, $params);
} else {
$response = $this->__execCURL($method, $params);
}
$response = json_decode($response, true);
if($response) {
$this->last_status = $response['status'];
} else {
$this->last_status = null;
}
return $response;
}
public function __execCURL($method, $params = array()) {
$params = array_merge($params, array("api_key" => $this->api_key, "currency" => $this->currency));
$ch = curl_init($this->api_base . $method);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if(!$response) {
$response = $this->__execPHP($method, $params);
}
curl_close($ch);
return $response;
}
public function send($to, $amount, $referral = "false") {
$r = $this->__exec("send", array("to" => $to, "amount" => $amount, "referral" => $referral));
if (array_key_exists("status", $r) && $r["status"] == 200) {
return array(
'success' => true,
'message' => 'Payment sent to your address using FaucetBOX.com',
'html' => '' . htmlspecialchars($amount) . ' satoshi was sent to . rawurlencode($to) . '">your FaucetBOX.com address.',
'html_coin' => '' . htmlspecialchars(rtrim(rtrim(sprintf("%.8f", $amount/100000000), '0'), '.')) . ' '.$this->currency.' was sent to . rawurlencode($to) . '">your FaucetBOX.com address.',
'balance' => $r["balance"],
'balance_bitcoin' => $r["balance_bitcoin"],
'response' => json_encode($r)
);
}
if (array_key_exists("message", $r)) {
return array(
'success' => false,
'message' => $r["message"],
'html' => '' . htmlspecialchars($r["message"]) . '',
'response' => json_encode($r)
);
}
return array(
'success' => false,
'message' => 'Unknown error.',
'html' => 'Unknown error.',
'response' => json_encode($r)
);
}
public function sendReferralEarnings($to, $amount) {
return $this->send($to, $amount, "true");
}
public function getPayouts($count) {
$r = $this->__exec("payouts", array("count" => $count) );
return $r;
}
public function getCurrencies() {
$r = $this->__exec("currencies");
return $r['currencies'];
}
public function getBalance() {
$r = $this->__exec("balance");
return $r;
}
}