Bitcoin Forum
November 11, 2024, 03:12:17 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Php script to display ASK price on a website  (Read 2276 times)
idev (OP)
Hero Member
*****
Offline Offline

Activity: 860
Merit: 1004


BTC OG and designer of the BitcoinMarket.com logo


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

Anyone have a script to display ASK prices on my web site?
preferably in php.
BitLex
Hero Member
*****
Offline Offline

Activity: 532
Merit: 505


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 (OP)
Hero Member
*****
Offline Offline

Activity: 860
Merit: 1004


BTC OG and designer of the BitcoinMarket.com logo


View Profile
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
Hero Member
*****
Offline Offline

Activity: 1904
Merit: 824


Defend Bitcoin and its PoW: bitcoincleanup.com


View Profile
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

.
.DuelbitsSPORTS.
▄▄▄███████▄▄▄
▄▄█████████████████▄▄
▄██████████████████████▄
██████████████████████████
███████████████████████████
██████████████████████████████
██████████████████████████████
█████████████████████████████
███████████████████████████
█████████████████████████
▀████████████████████████
▀▀███████████████████
██████████████████████████████
██
██
██
██

██
██
██
██

██
██
██
████████▄▄▄▄██▄▄▄██
███▄█▀▄▄▀███▄█████
█████████████▀▀▀██
██▀ ▀██████████████████
███▄███████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
▀█████████████████████▀
▀▀███████████████▀▀
▀▀▀▀█▀▀▀▀
OFFICIAL EUROPEAN
BETTING PARTNER OF
ASTON VILLA FC
██
██
██
██

██
██
██
██

██
██
██
10%   CASHBACK   
          100%   MULTICHARGER   
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



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
Merit: 10



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: 322
Merit: 251


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
Merit: 1003


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 (OP)
Hero Member
*****
Offline Offline

Activity: 860
Merit: 1004


BTC OG and designer of the BitcoinMarket.com logo


View Profile
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
Merit: 1003


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
Merit: 100



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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!