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.
#
# WSGI Proxy into the bitcoind daemon (which only listens on 127.0.0.1 for security).
# Rejects non-HTTPs connections, or non-POST requests
# Rejects queries that don't include a pre-shared secret value
#
# Apache calls this because of a directive in /etc/apache2/sites-available/xyz.com
#
import hashlib
import urllib2
def application(environ, start_response):
serverURL = "http://127.0.0.1:8332/"
def error_response(message):
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(message)))]
start_response('500 Internal Server error', response_headers)
return message
if environ.get("HTTPS") != "1":
return error_response("Insecure connections not allowed.")
request = environ.get("wsgi.input").read()
secret = request[0:32]
json_request = request[32:]
if hashlib.md5(" pre shared secret goes here "+json_request).hexdigest() != secret:
return error_response("Authentication failed.")
req = urllib2.Request(serverURL, json_request)
response = urllib2.urlopen(req)
json_response = response.read()
status = '200 OK'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(json_response)))]
start_response(status, response_headers)
return [json_response]
import hashlib
import jsonrpc
from google.appengine.api import urlfetch
def make_bitcoin_request(server_url, server_secret, method, params):
json_request = {
"jsonrpc": "2.0",
"id": str(time.time()),
"method": method, "params": params
}
json_string = jsonrpc.dumps(json_request)
secret = hashlib.md5(server_secret+json_string).hexdigest()
try:
fetch_result = urlfetch.fetch(payment_server,
method="POST", payload=secret+json_string,
headers={ 'Content-Type' : 'text/plain' })
except urlfetch.Error, e:
logging.error('make_bitcoin_request failed: '+str(e))
logging.error('Request:'+json_string)
return None
if fetch_result.status_code != 200:
logging.error('make_bitcoin_request failed; urlfetch status code %d'%(fetch_result.status_code))
logging.error('Request:'+json_string)
return None
r = jsonrpc.loads(fetch_result.content)
if r['error'] is not None:
logging.error('make_bitcoin_request failed; JSON error returned')
logging.error('Request:'+json_string)
logging.error('Result:'+fetch_result.content)
return None
return r['result']