Post
Topic
Board Development & Technical Discussion
Re: Sample account system using JSON-RPC needed
by
RudeDude
on 16/07/2010, 20:23:48 UTC
I should also point out that this site has some JSON code in Python.
http://www.alloscomp.com/bitcoin/

Specifically this code that checks the balance and sends it to a static address.
Code:
#!/usr/bin/python
import jsonrpc
MyBCAddress = 'YOUR BITCOIN ADDRESS HERE'

b = jsonrpc.ServiceProxy("http://localhost:8332/")
bal = float(b.getbalance())

if bal > 0.01:
    print "We have a balance of {0:.2f}BC. Sending...".format(bal)
    b.sendtoaddress(MyBCAddress,bal)
else:
    print "No coins here."