Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: sunnankar on May 21, 2012, 01:01:47 AM



Title: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: sunnankar on May 21, 2012, 01:01:47 AM
Since BlockExplorer is being unreliable I am trying to find a more efficient way to import the current value of a bitcoin address. Unfortunately, it looks like Blockchain.info import's with a BTC at the end so the numbers cannot be manipulated very easily.

Does anyone have a single cell HTMLimport formula for importing the current value of a BitCoin address? Pretty please.

Example:

Code:
C9=BitCoin Address
A1=ImportData("http://blockexplorer.com/q/getreceivedbyaddress/"&C9)
A2=ImportData("http://blockexplorer.com/q/getsentbyaddress/"&C9)
Current Balance = A1-A1

OR

=ImportHtml("http://blockchain.info/address/"&D6, "table", 2)

(spits out the final balance but is not usable because of the BTC at the end)



Title: Re: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: terrytibbs on May 21, 2012, 01:15:28 AM
http://blockchain.info/q/addressbalance/<address>

Divide by 1e8


Title: Re: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: drakahn on May 21, 2012, 01:22:34 AM
=REGEXREPLACE('the cell with the x.xxx BTC"," BTC",)

OR

=REGEXREPLACE((ImportHtml("http://blockchain.info/address/"&D6, "table", 2))," BTC",)


Title: Re: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: sunnankar on May 21, 2012, 01:24:24 AM
http://blockchain.info/q/addressbalance/<address>

Divide by 1e8

With the URL I get the 9 digit balance but I cannot seem to import that into the Google Doc so I can divide by 1e8. What am I missing with the Import formula?

Code:
D6=BitCoin Address
=ImportHtml("http://blockchain.info/q/addressbalance/"&D6)


Title: Re: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: sunnankar on May 21, 2012, 01:29:34 AM
=REGEXREPLACE('the cell with the x.xxx BTC"," BTC",)

OR

=REGEXREPLACE((ImportHtml("http://blockchain.info/address/"&D6, "table", 2))," BTC",)

Got the first one to work but had to fix the ' and ".

Code:
=REGEXREPLACE(C35," BTC",)

The second one says 'Not a strong: Transactions' so I think it is referring to the first cell imported from the table.


NOTE: After trying to manipulate the numbers this produces I have found it acts oddly. For example, the sum() function will not work but if you add the cells using the + symbol then it will work. Also, the numbers cannot be multiplied if you are using a reference to a cell instead of an integer (Ex. A6 versus 5). Very weird.


Title: Re: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: drakahn on May 21, 2012, 02:22:52 AM
Actually i noticed that too, i forgot to add that part, after the regexreplace do +1-1 to get a usable number


Title: Re: Help Please: HTML Import Google Doc for Current BitCoin Address Balance
Post by: sunnankar on June 06, 2012, 07:30:19 PM
Those those that are interested ZNORT987 (https://bitcointalk.org/index.php?action=profile;u=5218) has created some awesome tools for Google Doc importation (https://github.com/znort987/glbse-googledoc-macro). Follow the thread (https://bitcointalk.org/index.php?topic=85768.0).