Yeah. Mine started working again too.
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.
$a=ouvrirpage("http://mtgox.com/api/0/data/ticker.php");
$res=(json_decode($a, true));
$last = round ($res['ticker']['sell'], 2);
echo $last;
function ouvrirpage($site){
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
?>
function ouvrirpage($site){ //Make sure the function goes at the top of the page....
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Something Must Be Here/0.1"); //MtGox seems to REQUIRE this to be short...
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //This was missing
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
$a=ouvrirpage("https://mtgox.com/api/0/data/ticker.php"); ///updated to https
$res=(json_decode($a, true));
$last = round($res['ticker']['sell'], 2);
echo $last;
?>
$a=ouvrirpage("https://mtgox.com/api/0/data/ticker.php");
...
?>
$ wget -O - http://mtgox.com/api/0/data/ticker.php
--2011-12-20 09:39:53-- http://mtgox.com/api/0/data/ticker.php
Resolving mtgox.com... 72.52.5.67
Connecting to mtgox.com|72.52.5.67|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://mtgox.com/api/0/data/ticker.php [following]
--2011-12-20 09:39:53-- https://mtgox.com/api/0/data/ticker.php
Connecting to mtgox.com|72.52.5.67|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 153 [application/json]
Saving to: `STDOUT'
0% [ ] 0 --.-K/s {"ticker":{"high":4.5,"low":3.409,"avg":3.815959343,"vwap":3.886831982,"vol":1466100%[======================================>] 153 --.-K/s in 0s
2011-12-20 09:39:54 (2.03 MB/s) - written to stdout [153/153]
$
$a=ouvrirpage("http://mtgox.com/api/0/data/ticker.php");
$res=(json_decode($a, true));
$last = round ($res['ticker']['sell'], 2);
echo $last;
function ouvrirpage($site){
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
Hmmmm.... I don't know what to expect because I had someone here write this code for me for a 1 BTC bounty. :)
$a returns "redirecting you to http://mtgox.com/api/0/data/ticker.php" and $res doesn't seem to return anything.
At any rate, don't be fooled by the fact that there are now prices on my website. I've put them in manually for now, which is not the way I like to do things. So any help by someone well versed in php is still appreciated. Thanks!
?>
$a=ouvrirpage("http://mtgox.com/api/0/data/ticker.php");
$res=(json_decode($a, true));
$last = round ($res['ticker']['sell'], 2);
echo $last;
function ouvrirpage($site){
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
?>
$a=ouvrirpage("http://mtgox.com/api/0/data/ticker.php");
$res=(json_decode($a, true));
$last = round ($res['ticker']['sell'], 2);
echo $last;
function ouvrirpage($site){
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
?>