def send(url, ip="", autosend=False): if not get_mail_sent(url): set_mail_sent(url) data = cached(url) if not autosend: subject = "URL Abuse report from " + ip else: subject = "URL Abuse report sent automatically" msg = Message(subject, sender="*****@*****.**", recipients=["*****@*****.**"]) msg.body = digest(data) msg.body += "\n\n" msg.body += json.dumps(data, sort_keys=True, indent=4, separators=(",", ": ")) mail.send(msg)
def send(url, ip='', autosend=False): if not get_mail_sent(url): set_mail_sent(url) data = cached(url) if not autosend: subject = 'URL Abuse report from ' + ip else: subject = 'URL Abuse report sent automatically' msg = Message(subject, sender='*****@*****.**', recipients=["*****@*****.**"]) msg.body = digest(data) msg.body += '\n\n' msg.body += json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')) mail.send(msg)
def get_cache(): data = json.loads(request.data) url = data["query"] data = cached(url) dumped = json.dumps(data, sort_keys=True, indent=4, separators=(",", ": ")) return dumped
def get_cache(): data = json.loads(request.data) url = data["query"] data = cached(url) dumped = json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')) return dumped