mirror of
https://github.com/kennethreitz/coinbin.org.git
synced 2026-06-05 23:10:17 +00:00
@@ -14,3 +14,4 @@ html5lib = "*"
|
||||
bs4 = "*"
|
||||
requests = "*"
|
||||
simplejson = "*"
|
||||
flask-cache = "*"
|
||||
|
||||
@@ -46,9 +46,11 @@ class MWT(object):
|
||||
|
||||
return func
|
||||
|
||||
|
||||
def convert_to_decimal(f):
|
||||
return Decimal("{0:.8f}".format(f))
|
||||
|
||||
|
||||
class Coin():
|
||||
"""A Coin, unlike Mario's."""
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ from scraper import get_coins, get_coin, Coin
|
||||
from wallets import wallets
|
||||
|
||||
from flask import Flask, jsonify, render_template, request
|
||||
from flask.ext.cache import Cache
|
||||
from flask_sslify import SSLify
|
||||
|
||||
import maya
|
||||
@@ -17,11 +18,13 @@ pro_db = records.Database(os.environ['HEROKU_POSTGRESQL_TEAL_URL'])
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
app.debug = True
|
||||
|
||||
|
||||
sslify = SSLify(app)
|
||||
cache = Cache(app ,config={'CACHE_TYPE': 'simple'})
|
||||
|
||||
@app.route('/')
|
||||
@cache.cached(timeout=60)
|
||||
def hello():
|
||||
|
||||
lbc = get_coin('lbc')
|
||||
@@ -80,9 +83,6 @@ def get_history(coin):
|
||||
else:
|
||||
rows = db.query(q, coin=c.name)
|
||||
|
||||
|
||||
|
||||
|
||||
return jsonify(history=[
|
||||
{
|
||||
'value': r.value,
|
||||
|
||||
Reference in New Issue
Block a user