Added a helper function strip_to_json

This commit is contained in:
Mads Marquart
2017-05-05 11:39:51 +02:00
parent f4af46cacf
commit 05ca457946

View File

@@ -14,8 +14,11 @@ USER_AGENTS = [
def now():
return int(time()*1000)
def strip_to_json(text):
return re.sub(r"^[^{]*", '', text, 1);
def get_json(text):
return json.loads(re.sub(r"^[^{]*", '', text, 1))
return json.loads(strip_to_json(text))
def digit_to_char(digit):
if digit < 10: