Bitcoin Forum

Other => Beginners & Help => Topic started by: bbit on September 18, 2011, 10:25:52 PM



Title: Any bitcoin widget/ticker that lets me....
Post by: bbit on September 18, 2011, 10:25:52 PM
display the price of bitcoin that I would personally sell at.  So in other words,  if I want to sell my bitcoin at $6 I should be able to put that into the code or something  so its automated...any ideas?


Title: Re: Any bitcoin widget/ticker that lets me....
Post by: NothinG on September 18, 2011, 10:28:38 PM
Code:
<?php
function mtGoxRate()
{
$opts = array(
  'http'=> array(
'method'=>   "GET",
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$jdec json_decode($json);
$rate $jdec->{'ticker'}->{'avg'};
return $rate;
?>


Title: Re: Any bitcoin widget/ticker that lets me....
Post by: bbit on September 18, 2011, 10:32:46 PM
hmmmm I'll give that a try thanks!  ;D


Title: Re: Any bitcoin widget/ticker that lets me....
Post by: NothinG on September 18, 2011, 10:33:51 PM
You'll have to modify it a bit to show the USD price, but that will give you a good starting point.


Title: Re: Any bitcoin widget/ticker that lets me....
Post by: bbit on September 18, 2011, 10:36:30 PM
You'll have to modify it a bit to show the USD price, but that will give you a good starting point.

Yes, not sure I have a clue how to do that was going to just blop it into a page as is and see what happens lol hmmmm...


Title: Re: Any bitcoin widget/ticker that lets me....
Post by: bbit on September 18, 2011, 10:42:06 PM
Yes, I have no clue what I'm doing lol  :o