public
Last active

Tired of using your eyes to check how many dogecoins you've mined? Now you can use your ears ;-) This requires espeak to be installed and working, on Ubuntu/Debian based linux distributions you should be able to install it with: "sudo apt-get install espeak".

  • Download Gist
TalkingDoge.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
#Your mining address
ADDRESS='DGVboAJbUhnNzMn4F9z7D8LgaynphSU2Bb'
INTERVAL=300
 
from urllib2 import urlopen
from os import system
from time import sleep
from decimal import *
import sys
 
def fetch_balance():
balance = Decimal(urlopen('http://dogechain.info/chain/Dogecoin/q/addressbalance/'+ADDRESS).read())
return balance
 
def speak(words):
system("espeak '"+words+"' -v en+f3 -m -p 60 -s 120 --stdout|paplay")
 
balance = fetch_balance()
print 'Initial balance: '+str(balance)
 
while(True):
try:
new_balance = fetch_balance()
except Exception:
continue
print "FAAARK API DOWN!"
sleep(INTERVAL)
if(new_balance > balance):
difference = new_balance - balance
difference = round(difference, 2)
print '\nEarned: '+str(difference)+' new balance: '+str(new_balance)
speak(str(difference)+' dogecoins mined')
 
balance = new_balance
sys.stdout.write('.')
sys.stdout.flush()
sleep(INTERVAL)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.