Bitcoin Forum
May 22, 2024, 02:58:41 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to extract a specific "getmininginfo" value to use in a function ?  (Read 764 times)
unick (OP)
Sr. Member
****
Offline Offline

Activity: 504
Merit: 254


View Profile
August 14, 2013, 07:43:10 PM
 #1

Hi,

I am trying to figure out a way to extract the values in the output of getmininginfo in a shell script.

let's say I want to get block and difficulty values.  If it were in PHP I would use something like array[key].  But I am not sure how to do this with the output of getmininginfo.  Any one has a clue or could point me in the right direction?

Thanks in advance!

Awesome Explorers for Awesome Coins | Show some BTC love here: 1AAYAZgaz2me7hyumexUZzcyGRZEYtCx5C
HoboNickels: hbn.blockx.info | BottleCaps: cap.blockx.info | GrowthCoin: grw.blockx.info
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
August 14, 2013, 07:47:07 PM
 #2

The output is "encoded"(more like formatted) with JSON, look it up. PHP has JSON support via json_encode/json_decode.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
unick (OP)
Sr. Member
****
Offline Offline

Activity: 504
Merit: 254


View Profile
August 14, 2013, 07:50:50 PM
 #3

thanks for the quick reply, I'll look it up Smiley

Awesome Explorers for Awesome Coins | Show some BTC love here: 1AAYAZgaz2me7hyumexUZzcyGRZEYtCx5C
HoboNickels: hbn.blockx.info | BottleCaps: cap.blockx.info | GrowthCoin: grw.blockx.info
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!