stockholm/makefu/2configs/urlwatch/hook.py

17 lines
372 B
Python
Raw Normal View History

2017-07-02 21:06:36 +00:00
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
2017-07-02 21:09:12 +00:00
log.setLevel(level=logging.INFO)
import re
import json
from urlwatch import filters
class JsonFilter(filters.RegexMatchFilter):
MATCH = {'url': re.compile('https?://api.github.com/.*')}
def filter(self, data):
return json.dumps(json.loads(data),indent=2,sort_keys=True)