the following command seemed to fix it
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 9 11:00:14 2018
@author: kerrywashington
"""
import socket
import json
class BFGMinerAPI(object):
""" Cgminer RPC API wrapper. """
def __init__(self, host='mylocalhost', port=4028):
self.data = {}
self.host = host
self.port = port
def command(self, command, arg=None):
""" Initialize a socket connection,
send a command (a json encoded dict) and
receive the response (and decode it).
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((self.host, self.port))
payload = {"command": command}
if arg is not None:
# Parameter must be converted to basestring (no int)
payload.update({'parameter': unicode(arg)})
sock.send(json.dumps(payload))
received = self._receive(sock)
print(received)
finally:
sock.shutdown(socket.SHUT_RDWR)
sock.close()
return json.loads(received[:-1])
def _receive(self, sock, size=4096):
msg = ''
while 1:
chunk = sock.recv(size)
if chunk:
msg += chunk
else:
break
return msg
def __getattr__(self, attr):
def out(arg=None):
return self.command(attr, arg)
return out
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2013 Christian Berendt
# Copyright 2013 Luke Dashjr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version. See COPYING for more details.
import argparse
import json
import logging
import pprint
import socket
logging.basicConfig(
format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG
)
parser = argparse.ArgumentParser()
parser.add_argument("command", default="summary", nargs='?')
parser.add_argument("parameter", default="", nargs='?')
parser.add_argument("--hostname", default="localhost")
parser.add_argument("--port", type=int, default=4028)
args = parser.parse_args()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((args.hostname, args.port))
except socket.error, e:
print "Error receiving data: %s" % e
logging.error(e)
try:
s.send("{\"command\" : \"%s\", \"parameter\" : \"%s\"}"
% (args.command, args.parameter)
)
except socket.error, e:
print "Error receiving data: %s" % e
logging.error(e)
data = ''
while True:
try:
newdata = s.recv(1024)
if newdata:
data += newdata
print('Data:' + newdata)
else:
break
except socket.error, e:
break
try:
s.close()
except socket.error,e:
logging.error(e)
if data:
data = json.loads(data.replace('\x00', ''))
print('dat data')
pp = pprint.PrettyPrinter()
pp.pprint(data)