Bitcoin Forum
May 21, 2024, 08:40:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Looking for a line of code that will read transactions values on the blockchain  (Read 572 times)
WorldOfBitcoin (OP)
Member
**
Offline Offline

Activity: 102
Merit: 10



View Profile
September 25, 2012, 12:06:44 AM
Last edit: September 25, 2012, 02:02:24 AM by WorldOfBitcoin
 #1

and submit them into a SQL database.

Anyone got some good “for dummies” write ups on how to implement the blockchain.info api into a website like that?

trying to make sense of this
http://blockchain.info/api/blockchain_api
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
September 25, 2012, 02:03:34 AM
 #2

Use the json_decode() function.  Here's an easy way to copy-paste chunks of JSON into PHP:

Code:
<?php
var_dump
(json_decode(<<<JSON
{
"hash":"b6f6991d03df0e2e04dafffcd6bc418aac66049e2cd74b80f14ac86db1e3f0da",
"ver":1,
"vin_sz":1,
"vout_sz":2,
"lock_time":"Unavailable",
"size":258,
"relayed_by":"64.179.201.80",
    "block_height": 12200,
"tx_index":"12563028",
"inputs":[


{
"prev_out":{
"hash":"a3e2bcc9a5f776112497a32b05f4b9e5b2405ed9",
"value":"100000000",
"tx_index":"12554260",
"n":"2"
},
"scriptSig":"Unavailable"
}

],
"out":[

{
"value":"98000000",
"hash":"29d6a3540acfa0a950bef2bfdc75cd51c24390fd",
"scriptPubKey":"Unavailable"
},
        
{
"value":"2000000",
"hash":"17b5038a413f5c5ee288caa64cfab35a0c01914e",
"scriptPubKey":"Unavailable"
}
        
]
}
JSON
));

Replace the stuff between <<<JSON and JSON with the JSON code.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
WorldOfBitcoin (OP)
Member
**
Offline Offline

Activity: 102
Merit: 10



View Profile
September 25, 2012, 02:19:52 AM
 #3

nice, will work on that.

I found a link on Websocket API
https://blockchain.info/api/api_websocket

going to read up on this, thinks its going to be the best route.
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!