the public repo for the e-paper bulletin board. It's a bulletin board that syncs over scuttlebutt :)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
535 B

#!/usr/bin/python
# -*- coding:utf-8 -*-
# apparently json.loads doesn't parse multiple entry json??
# So we gotta fux with it
# via https://stackoverflow.com/questions/22112439/valueerror-extra-data-while-loading-json
import json
import re
nonspace = re.compile(r'\S')
def parsy(j):
decoder = json.JSONDecoder()
pos = 0
while True:
matched = nonspace.search(j, pos)
if not matched:
break
pos = matched.start()
decoded, pos = decoder.raw_decode(j, pos)
yield decoded