Bitcoin Forum
April 26, 2017, 12:06:27 PM *
News: Latest stable version of Bitcoin Core: 0.14.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Php script to display ASK price on a website  (Read 2048 times)
idev
Hero Member
*****
Offline Offline

Activity: 847


View Profile WWW
February 08, 2011, 07:00:30 PM
 #1

Anyone have a script to display ASK prices on my web site?
preferably in php.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1493208387
Hero Member
*
Offline Offline

Posts: 1493208387

View Profile Personal Message (Offline)

Ignore
1493208387
Reply with quote  #2

1493208387
Report to moderator
1493208387
Hero Member
*
Offline Offline

Posts: 1493208387

View Profile Personal Message (Offline)

Ignore
1493208387
Reply with quote  #2

1493208387
Report to moderator
BitLex
Hero Member
*****
Offline Offline

Activity: 588


View Profile
February 08, 2011, 07:25:12 PM
 #2

how about this:
Code:
$mtg_url='http://mtgox.com/code/data/ticker.php';
$handle = fopen ($mtg_url, "r");
$output = fread($handle, 1024);
fclose($handle);
$obj = json_decode($output);
$bid = $obj->ticker->buy;
$ask = $obj->ticker->sell;

echo "bid: ".$bid." | ask: ".$ask;

idev
Hero Member
*****
Offline Offline

Activity: 847


View Profile WWW
February 08, 2011, 11:12:36 PM
 #3

how about this:
Code:
$mtg_url='http://mtgox.com/code/data/ticker.php';
$handle = fopen ($mtg_url, "r");
$output = fread($handle, 1024);
fclose($handle);
$obj = json_decode($output);
$bid = $obj->ticker->buy;
$ask = $obj->ticker->sell;

echo "bid: ".$bid." | ask: ".$ask;


Thanks a lot man, sent you 2.50bc for your time and effort.
Cheers  Cool
tiCeR
Sr. Member
****
Offline Offline

Activity: 271



View Profile WWW
August 03, 2011, 10:29:13 AM
 #4

can someone tell me the hole working php script ? i not get it working ;(

thx pls private message me

NothinG
Hero Member
*****
Offline Offline

Activity: 560



View Profile
August 03, 2011, 04:02:04 PM
 #5

can someone tell me the hole working php script ? i not get it working ;(

thx pls private message me
Code:
<?php
$mtg_url
='https://mtgox.com/code/data/ticker.php';
$handle fopen ($mtg_url"r");
$output fread($handle1024);
fclose($handle);
$obj json_decode($output);
$bid $obj->ticker{'buy'};
$ask $obj->ticker{'sell'};

echo 
"bid: ".$bid." | ask: ".$ask;
?>
Tongue

brandon@sourcewerks
Member
**
Offline Offline

Activity: 62



View Profile
August 04, 2011, 12:10:52 AM
 #6

Take a look at the libraries I have created:

https://github.com/sourcewerks
nhodges
Sr. Member
****
Offline Offline

Activity: 308


View Profile
August 05, 2011, 12:14:16 AM
 #7

how about this:
Code:
$mtg_url='http://mtgox.com/code/data/ticker.php';
$handle = fopen ($mtg_url, "r");
$output = fread($handle, 1024);
fclose($handle);
$obj = json_decode($output);
$bid = $obj->ticker->buy;
$ask = $obj->ticker->sell;

echo "bid: ".$bid." | ask: ".$ask;

If you're on an IIS server and opt to use the https protocol, the server will close the connection without sending close_notify, and PHP will report an error of "SSL: Fatal Protocol Error" ... for those of you on IIS Shocked please use file_get_contents or the cURL library.

Xenland
Legendary
*
Offline Offline

Activity: 980


I'm not just any shaman, I'm a Sha256man


View Profile
August 05, 2011, 01:46:26 AM
 #8

Mining farm does some of the similar codes located in the blockUpdater.php file in side of the /req/cronjobs/ folder.
idev
Hero Member
*****
Offline Offline

Activity: 847


View Profile WWW
August 05, 2011, 02:42:59 PM
 #9

Take a look at the libraries I have created:

https://github.com/sourcewerks

How to fix this error please ?
Code:
Fatal error: Call to undefined function str_getcsv() in /home/user/public_html/bctest/bitcoinCharts.php on line 122

Xenland
Legendary
*
Offline Offline

Activity: 980


I'm not just any shaman, I'm a Sha256man


View Profile
August 06, 2011, 04:18:33 AM
 #10

Take a look at the libraries I have created:

https://github.com/sourcewerks

How to fix this error please ?
Code:
Fatal error: Call to undefined function str_getcsv() in /home/user/public_html/bctest/bitcoinCharts.php on line 122



I dont use his software but it looks like you forgot to include() a file or require_once() a file either or should fix your prob
indicasteve
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
August 06, 2011, 06:51:40 AM
 #11

You need PHP 5 >= 5.3.0 to use this function.

There are some workarounds here:
http://php.net/manual/en/function.str-getcsv.php

Art Express!  Native American Art, Crafts and Weapons!  coingig.com/ArtExpress
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!