Skip to content

Instantly share code, notes, and snippets.

@maxhodak
Created April 12, 2013 12:17
Show Gist options
  • Save maxhodak/5371621 to your computer and use it in GitHub Desktop.
Save maxhodak/5371621 to your computer and use it in GitHub Desktop.
mtgox cron job
import json, base64
# wget https://data.mtgox.com/api/0/bitcoin_tx.php -> txs.json
fd = open("txs.json")
parsed = json.loads(fd.read())
parsed = parsed["result"]
out = open("out.txt", "w")
for row in parsed:
out.write("bitcoind sendrawtransaction \"%s\"\n" % base64.b64decode(row["tx"]).encode("hex"))
# cat out.txt | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment