473,387 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with Bitcoin Value Index

Hello, I'm using this PHP script to pull a single bitcoin price from Mt.Gox. However, Mt.Gox shut down and now script is not working. I'm trying to use another API like bitstamp.net/api/ticker/ and blockchain.info/ticker. I have tried everything but the script is not working. I really need help with this. this is for a site I'm developing for a client of mine named BitCoinValues.net

Regards
Matt

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.          //first fetch the current rate from MtGox
  3.          $ch = curl_init('https://mtgox.com/api/0/data/ticker.php');
  4.                  curl_setopt($ch, CURLOPT_REFERER, 'Mozilla/5.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
  5.                  curl_setopt($ch, CURLOPT_USERAGENT, "CakeScript/0.1");
  6.                  curl_setopt($ch, CURLOPT_HEADER, 0);
  7.                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8.                  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  9.                  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  10.                  $mtgoxjson = curl_exec($ch);
  11.                  curl_close($ch);
  12.  
  13.          //decode from an object to array
  14.                  $output_mtgox = json_decode($mtgoxjson);
  15.                  $output_mtgox_1 = get_object_vars($output_mtgox);
  16.                  $mtgox_array = get_object_vars($output_mtgox_1['ticker']);
  17.  
  18.  ?>
  19.  <br/>
  20.  <br/>
  21.  Last:&nbsp;<?php echo $mtgox_array['last'];   ?><br/>
  22.  High:&nbsp;<?php echo $mtgox_array['high'];   ?><br/>
  23.  Low:&nbsp;&nbsp;<?php echo $mtgox_array['low'];   ?><br/>
  24.  Avg:&nbsp;&nbsp;&nbsp;<?php echo $mtgox_array['avg'];   ?><br/>
  25.  Vol:&nbsp;&nbsp;&nbsp;<?php echo $mtgox_array['vol'];   ?><br/>
May 23 '14 #1
0 1198

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bill McCormick | last post by:
I have a SELECT stmt: SELECT category.category, category.description, ROUND(SUM(CASE WHEN ((saleitem.price != 0) AND (sale.discount_pct != 0)) THEN saleitem.quantity * saleitem.price * (1 -...
0
by: sri | last post by:
Hi, I have a datatable to store some values like name, id etc. in ASP.NET I have scenario where i need to modify more than one records of the datatable . I am trying to use dataview as below. ...
1
by: jsegars | last post by:
I have a table with the following 2 fields: Serial # ( values range 1 to 1400 and represent a birth certif #) Location (text field that is the name of a geographical location appearing on the...
2
by: yo_mismo | last post by:
Hi, I send a parameter from a Form (Form1) to an other form (Form2): Form2 frm2 = new Form2(); frm2.number_frm2 = number_frm1; frm2.Show(); The problem i got is that the variable...
2
by: rocksoft | last post by:
Hi I am working in asp.net with C# web application, I have used visual studio 2003, i have used dropdownlist in my application to populate the data from mysql database, i have got problem while...
4
jeffbroodwar
by: jeffbroodwar | last post by:
Hello, i have a problem about assigning a char value to a byte... please check the code below : ======================================================== Scenario # 1 : This code doesn't work : ...
1
by: =?Utf-8?B?QnJpYW5ESA==?= | last post by:
Hi I am looking for examples of how to find the row index in a Datagridview control by comparing a string value to the value in a Cell. Thanks Brian
0
by: Spam Catcher | last post by:
Hi all, I'm trying to set the DataGridViewCell.Value of an unbound column. I can set the value in code, but the value isn't being displayed. I tried to RefreshEdit/EndEdit/Invalidate the...
4
by: cephal0n | last post by:
Hi everyone! I've been studying SELECT INTO in vba and made my own. I was successful in generating my own table, strSql = "SELECT * INTO tblTemp49 FROM qryUnq49" conn.Execute strSql now I...
4
navanova
by: navanova | last post by:
Hi Guys, I keep on having an error message that says "InvalidArgument=Value of '-1' is not valid for 'index'. Parameter name: index" Can anybody tell me what the problem is please? The part...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.