From 95624a125769b71108ceed5329883134859a49a3 Mon Sep 17 00:00:00 2001 From: selfisekai Date: Thu, 10 Sep 2020 00:28:05 +0200 Subject: [PATCH] e-mail address randomizer --- librefi/utils.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/librefi/utils.py b/librefi/utils.py index 9ccac01..ba3c73a 100644 --- a/librefi/utils.py +++ b/librefi/utils.py @@ -2,6 +2,8 @@ import re from urllib.parse import parse_qs, quote as qs_quote +from datetime import datetime +import random def get_user_agent(): @@ -9,6 +11,28 @@ def get_user_agent(): return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" +def get_email_address(): + time_now = datetime.now() + if time_now.month == 5 and time_now.day == 17: + # https://en.wikipedia.org/wiki/International_Day_Against_Homophobia,_Transphobia_and_Biphobia + return random.choice([ + "biuro@ordoiuris.pl", + "kontakt@stronazycia.pl", + "kontakt@petycjaonline.pl", + "gejprzeciwkoswiatu@gmail.com", + "biuro.prasowe@konfederacja.net", + "biuro@pis.org.pl", + "Zbigniew.Ziobro@sejm.pl", + ]) + + email = "" + for i in range(random.randint(6, 18)): + email += chr(97 + random.randint(0, 24)) + return email + "@" + random.choice([ + "gmail.com", "outlook.com", "live.com", + ]) + + def regex_search_string(regexes, string, default=None): if not isinstance(regexes, list): regexes = [regexes]