diff --git a/fbchat/utils.py b/fbchat/utils.py index d8d3e65..fdf2580 100644 --- a/fbchat/utils.py +++ b/fbchat/utils.py @@ -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: