Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

TWEAK: Use proxy for bitcoinaverage.com. #516

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion market/btcprice.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from urllib2 import Request, urlopen, URLError
from datetime import datetime, timedelta

BITCOIN_PRICE_ENDPOINT = "https://ticker.openbazaar.org/api"

class BtcPrice(Thread):
"""
Expand Down Expand Up @@ -87,7 +88,7 @@ def dictForUrl(url):
return json.loads(result)

def loadbitcoinaverage(self):
for currency, info in self.dictForUrl('https://api.bitcoinaverage.com/ticker/global/all').iteritems():
for currency, info in self.dictForUrl(BITCOIN_PRICE_ENDPOINT).iteritems():
if currency != "timestamp":
self.prices[currency] = info["last"]

Expand Down