• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Can't programmatically get wallet balance from explorer.darkchain.io

calnaughtonjnr

Active member
Foundation Member
I have a routine that gets my wallet balance and sends it to me. It's stopped working today though. It grabs it from here

http://explorer.darkcoin.io/chain/Darkcoin/q/addressbalance/

But for some reason, I'm now getting a 503 server unavailable error. It works fine if I paste the URL into a browser, but not from the .NET program. Does anyone know why this may be? Is there some new protection of some sort on that server?
 
I have a routine that gets my wallet balance and sends it to me. It's stopped working today though. It grabs it from here

http://explorer.darkcoin.io/chain/Darkcoin/q/addressbalance/

But for some reason, I'm now getting a 503 server unavailable error. It works fine if I paste the URL into a browser, but not from the .NET program. Does anyone know why this may be? Is there some new protection of some sort on that server?
darkcoin.io apparantly was getting DDOS's earlier today, maybe some DDOS protection has been implemented which means you're app will have to pretend to be a browser by sending some fake header stuff.

If it helps, this is what I did (python, I know nothing about .NET but you get the idea) to plunder chainz:
Code:
######################################################### need to fool cloudflare!
site = ("http://chainz.cryptoid.info/drk/api.dws?q=getbalance&a=" + address)
hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'}
######################################################### cloudflare hoodwinked!
req = urllib2.Request(site, headers=hdr)
try:
     page = urllib2.urlopen(req)
except urllib2.HTTPError, e:
     print e.fp.read()
data = page.read()
 
darkcoin.io apparantly was getting DDOS's earlier today, maybe some DDOS protection has been implemented which means you're app will have to pretend to be a browser by sending some fake header stuff.

If it helps, this is what I did (python, I know nothing about .NET but you get the idea) to plunder chainz:
Code:
######################################################### need to fool cloudflare!
site = ("http://chainz.cryptoid.info/drk/api.dws?q=getbalance&a=" + address)
hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'}
######################################################### cloudflare hoodwinked!
req = urllib2.Request(site, headers=hdr)
try:
     page = urllib2.urlopen(req)
except urllib2.HTTPError, e:
     print e.fp.read()
data = page.read()

Ahh, very kind, thank you. I love this by the way!
 
... need to fool cloudflare!...

I don't need it, but it's good to know how it's done if I _should_ need it. Thanks :smile:

BTW, I understand the reasons to use Cloudflare, but I don't like it because more and more sites are using it and Cloudflare can track what you do.

Kinda like googlesyndication :eek:
 
Back
Top