Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

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".

View TalkingDoge.py
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.