![Grin](https://bitcointalk.org/Smileys/default/grin.gif)
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.
if(! file_exists($cache) || filemtime($cache) + (4 * 60 * 60) < time() || filesize($cache) <= 1024)
{
$webpage = retrieveURL("https://coinmarketcap.com/exchanges/volume/24-hour/");
file_put_contents($cache, $webpage);
}
else
$webpage = file_get_contents($cache);
preg_match_all('/BTC\/'.$waehrung.'.+? volume" .+? data-btc="([0-9.\?]+)".+? price" data-usd="([0-9.\?]+)"/s', $webpage, $found, PREG_SET_ORDER);
$Kurs = 0;
$Volume = 0;
foreach($found as $hit) //das Gesamtgewicht, um die einzelnen Gewichtungen beurteilen zu können
$Volume += (float) $hit[1]; //falls ein Gewicht == "?" ist sollte das als 0 nicht ins Gewicht fallen
foreach($found as $hit)
{
//~ daten1 * gewichtung1 + daten2 * gewichtung2 + ... + datenN * gewichtungN
//~ wenn (float) $var == 0 ist wird halt 0 dazuaddiert!
$Kurs += (float) $hit[2] * ((float) $hit[1] / $Volume);
}
//~ print "der Kurs ergibt sich aus Daten über ein Volumen von ".$Volume." BTC\n";
return round($Kurs, 8, PHP_ROUND_HALF_EVEN);
//This is a PHP(4/5) script example on how eurofxref-daily.xml can be parsed
//Read eurofxref-daily.xml file in memory
//For this command you will need the config
//option allow_url_fopen=On (default)
$XMLContent=file("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml");
//the file is updated daily between 2.15 p.m. and 3.00 p.m. CET
foreach($XMLContent as $line){
if(preg_match("/currency='([[:alpha:]]+)'/",$line,$currencyCode)){
if(preg_match("/rate='([[:graph:]]+)'/",$line,$rate)){
//Output the value of 1EUR for a currency code
echo'1€='.$rate[1].' '.$currencyCode[1].'
'."\n";
//--------------------------------------------------
//Here you can add your code for inserting
//$rate[1] and $currencyCode[1] into your database
//--------------------------------------------------
}
}
}