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_once("getInfo.php");
$getInfo = new getInfo();
$infoObject = $getInfo->getInfoObject();
echo(""
);
print_r($infoObject);
echo("
class getInfo
{
var $difficultyUrl = "http://blockexplorer.com/q/getdifficulty";
var $estimateUrl = "http://blockexplorer.com/q/estimate";
var $hashrateUrl = "http://blockchain.info/q/hashrate";
var $intervalUrl = "http://blockexplorer.com/q/interval";
var $hashesUrl = "http://blockexplorer.com/q/hashestowin";
var $difficulty;
var $estimate;
var $hashrate;
var $interval;
var $hashestowin;
public function getInfo()
{
$this->curl($this->difficultyUrl, $result);
$this->difficulty = $result;
$this->curl($this->estimateUrl, $result);
$this->estimate = $result;
$this->curl($this->hashrateUrl, $result);
$this->hashrate = $result;
$this->curl($this->intervalUrl, $result);
$this->interval = $result;
$this->curl($this->hashesUrl, $result);
$this->hashestowin = $result;
}
public function curl($url, &$result)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch));
curl_close($ch);
return 1;
}
public function getInfoObject()
{
return $this;
}
}
?>
$urls = array(
"http://blockexplorer.com/q/getdifficulty",
"http://blockexplorer.com/q/estimate",
"http://blockchain.info/q/hashrate",
"http://blockexplorer.com/q/interval",
"http://blockexplorer.com/q/hashestowin"
);
// Class to run parallel GET requests and return the transfer
class ParallelGet
{
function __construct($urls)
{
// Create get requests for each URL
$mh = curl_multi_init();
foreach($urls as $i => $url)
{
$ch[$i] = curl_init($url);
curl_setopt($bhash4win_Curl, CURLOPT_HEADER, 0);
curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);
curl_multi_add_handle($mh, $ch[$i]);
}
// Start performing the request
do {
$execReturnValue = curl_multi_exec($mh, $runningHandles);
} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);
// Loop and continue processing the request
while ($runningHandles && $execReturnValue == CURLM_OK) {
// Wait forever for network
$numberReady = curl_multi_select($mh);
if ($numberReady != -1) {
// Pull in any new data, or at least handle timeouts
do {
$execReturnValue = curl_multi_exec($mh, $runningHandles);
} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);
}
}
// Check for any errors
if ($execReturnValue != CURLM_OK) {
trigger_error("Curl multi read error $execReturnValue\n", E_USER_WARNING);
}
// Extract the content
foreach($urls as $i => $url)
{
// Check for errors
$curlError = curl_error($ch[$i]);
if($curlError == "") {
$res[$i] = curl_multi_getcontent($ch[$i]);
echo $res[$i]."
\n";
} else {
print $i."error to get a result"."\n";
}
// Remove and close the handle
curl_multi_remove_handle($mh, $ch[$i]);
curl_close($ch[$i]);
}
// Clean up the curl_multi handle
curl_multi_close($mh);
}
}
?>
echo("");
print_r($res);
echo("
");
include('a.php');
echo("");
print_r($res);
echo("");
print_r($res);
echo("
");
// Define the URLs
$urls = array(
"http://example.com/1/",
"http://example.com/2/",
"http://example.com/3/",
"http://example2.com/4/",
"http://example3.com/5/",
);
// Class to run parallel GET requests and return the transfer
class ParallelGet
{
function __construct($urls)
{
// Create get requests for each URL
$mh = curl_multi_init();
foreach($urls as $i => $url)
{
$ch[$i] = curl_init($url);
curl_setopt($ch[$i], CURLOPT_HEADER, 0);
curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);
curl_multi_add_handle($mh, $ch[$i]);
}
// Start performing the request
do {
$execReturnValue = curl_multi_exec($mh, $runningHandles);
} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);
// Loop and continue processing the request
while ($runningHandles && $execReturnValue == CURLM_OK) {
// Wait forever for network
$numberReady = curl_multi_select($mh);
if ($numberReady != -1) {
// Pull in any new data, or at least handle timeouts
do {
$execReturnValue = curl_multi_exec($mh, $runningHandles);
} while ($execReturnValue == CURLM_CALL_MULTI_PERFORM);
}
}
// Check for any errors
if ($execReturnValue != CURLM_OK) {
trigger_error("Curl multi read error $execReturnValue\n", E_USER_WARNING);
}
// Extract the content
foreach($urls as $i => $url)
{
// Check for errors
$curlError = curl_error($ch[$i]);
if($curlError == "") {
$res[$i] = curl_multi_getcontent($ch[$i]);
echo $res[$i]."
\n";
}
else {
print $i."error to get result"."\n";
}
// Remove and close the handle
curl_multi_remove_handle($mh, $ch[$i]);
curl_close($ch[$i]);
}
// Clean up the curl_multi handle
curl_multi_close($mh);
}
// Print the response data
}
?>
include('a.php');
//* here below the exact place I want to show them with diff data format. but totally no idea cuz I'm noob on scripts.[/color][/b]*//
//* just guess need another foreach and define to get each $res(i) *//
echo number_format($res[1],2)."
\n";
echo number_format($res[2],0)."
\n";
echo ceil(number_format($res[3],1))."
\n";
?>