summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/urlwatch/hook.py
blob: fc598423f14aeafea30dc60829bcc79a51c25675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
# log.setLevel(level=logging.INFO)
def filter(url, data):
    log.info("handling url '{}'".format(url))
    if "api.github.com" in url:
        import json
        log.info("url is a github api link, assuming json")
        return json.dumps(json.loads(data),indent=2)

    return data