improve e-mail address generator
parent
8f78531cf6
commit
adf9355069
252
librefi/utils.py
252
librefi/utils.py
|
@ -3,7 +3,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import re
|
||||
from datetime import datetime
|
||||
from datetime import date
|
||||
import random
|
||||
|
||||
from .compat import (
|
||||
|
@ -85,25 +85,253 @@ def get_user_agent():
|
|||
|
||||
|
||||
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",
|
||||
day_today = date.today().strftime('%m-%d')
|
||||
if day_today in ( # "MM-DD"
|
||||
'05-17', # https://en.wikipedia.org/wiki/International_Day_Against_Homophobia,_Transphobia_and_Biphobia
|
||||
'09-28', # https://en.wikipedia.org/wiki/International_Safe_Abortion_Day
|
||||
'11-20', # https://en.wikipedia.org/wiki/Transgender_Day_of_Remembrance
|
||||
'12-10', # https://en.wikipedia.org/wiki/Human_Rights_Day
|
||||
):
|
||||
return random.choice((
|
||||
"kontakt@stronazycia.pl",
|
||||
"kontakt@petycjaonline.pl",
|
||||
"gejprzeciwkoswiatu@gmail.com",
|
||||
"biuro.prasowe@konfederacja.net",
|
||||
"biuro@pis.org.pl",
|
||||
"Zbigniew.Ziobro@sejm.pl",
|
||||
])
|
||||
"Sebastian.Kaleta@sejm.pl",
|
||||
"Michal.Wojcik@sejm.pl",
|
||||
"Tomasz.Rzymkowski@sejm.pl",
|
||||
|
||||
email = ""
|
||||
for i in range(random.randint(6, 18)):
|
||||
# LGB Alliance
|
||||
"developers@lgballiance.org.uk",
|
||||
"koalicjalgb@gmail.com",
|
||||
"frentelgb@gmail.com",
|
||||
"alianzalgb@gmail.com",
|
||||
"lgsolidarnamreza@gmail.com",
|
||||
"redlesbianasgaysbisexuales@gmail.com",
|
||||
|
||||
# Agenda Europe - https://agendaeurope.wordpress.com/links-2/
|
||||
"info@acton.org",
|
||||
"istitutoacton@acton.org",
|
||||
"info@institutoacton.com.ar",
|
||||
"kmauren@acton.org",
|
||||
"sgregg@acton.org",
|
||||
"kabbs@acton.org",
|
||||
"tvogt@acton.org",
|
||||
"sbarrows@acton.org",
|
||||
"croelofs@acton.org",
|
||||
"kmauren@acton.org",
|
||||
"ekohn@acton.org",
|
||||
"mseverance@acton.org",
|
||||
"info@c-fam.org",
|
||||
"Media@c-fam.org",
|
||||
"Hannah@c-fam.org",
|
||||
"press@citizengo.org",
|
||||
"english@citizengo.org",
|
||||
"admin@dialoguedynamics.com",
|
||||
"ipf@ipfe.org",
|
||||
"internationalipf@ipfe.org",
|
||||
"ehertfelder@ipfe.org",
|
||||
"donor@lifesitenews.com",
|
||||
"support@lifesitenews.com",
|
||||
"corrections@lifesitenews.com",
|
||||
"advertising@lifesitenews.com",
|
||||
"marketing@lifesitenews.com",
|
||||
"submit@lifesitenews.com",
|
||||
"info@od.org.au",
|
||||
"finland@od.org",
|
||||
"contacto@puertasabiertasal.org",
|
||||
"philippines@od.org",
|
||||
"info@puertasabiertas.org",
|
||||
"info@opendoors.at",
|
||||
"info@portesouvertes.ch",
|
||||
"contact@portesouvertes.fr",
|
||||
"info@opendoors.pl",
|
||||
"sweden@od.org",
|
||||
"sarab@od.org",
|
||||
"presskontakt@od.org",
|
||||
"falecom@portasabertas.org.br",
|
||||
"info@opendoors.de",
|
||||
"youth@opendoors.de",
|
||||
"pressebuero@opendoors.de",
|
||||
"info@od.org.nz",
|
||||
"info@porti-deschise.org",
|
||||
"info@portesouvertes.ch",
|
||||
"opendoorsca@odcan.org",
|
||||
"enquiryhk@od.org",
|
||||
"norway@od.org",
|
||||
"mortena@od.org",
|
||||
"lindaa@od.org",
|
||||
"southafrica@od.org",
|
||||
"inspire@opendoorsuk.org",
|
||||
"odireland@opendoorsuk.org",
|
||||
"denmark@od.org",
|
||||
"info@porteaperteitalia.org",
|
||||
"cristinam@od.org",
|
||||
"cristiann@od.org",
|
||||
"odi-nl@od.org",
|
||||
"info@fedsoc.org",
|
||||
"Info@C-FAM.org",
|
||||
"info@womenworldplatform.com",
|
||||
"info@wcfverona.org",
|
||||
"webadmin@ifamnews.com",
|
||||
"info@profam.org",
|
||||
"wya@wya.net",
|
||||
"africa@wya.net",
|
||||
"asiapacific@wya.net",
|
||||
"europe@wya.net",
|
||||
"latinamerica@wya.net",
|
||||
"mena@wya.net",
|
||||
"northamerica@wya.net",
|
||||
"info@europeanrenewal.org",
|
||||
"secretariat@eclj.org",
|
||||
"office@ecpm.info",
|
||||
"office@europeandignitywatch.org",
|
||||
"info@oneofus.eu",
|
||||
"info@familienforum.at",
|
||||
"postbox@imabe.org",
|
||||
"office@ief.at",
|
||||
"office@youthforlife.net",
|
||||
"office@kairos-pr.com",
|
||||
"office@lebenskonferenz.at",
|
||||
"info@pro-life.by",
|
||||
"svabulgaria@gmail.com",
|
||||
"press@uimeobitelji.net",
|
||||
"cenap@cenap.cz",
|
||||
"info@hnutiprozivot.cz",
|
||||
"rodiny@rodiny.cz",
|
||||
"oujezdska@rodiny.cz",
|
||||
"charvatova@rodiny.cz",
|
||||
"horakova@rodiny.cz",
|
||||
"pavlisova@rodiny.cz",
|
||||
"kucerova@rodiny.cz",
|
||||
"jegvilleve@rettentilliv.dk",
|
||||
"leder@abortlinien.dk",
|
||||
"ung@rettentilliv.dk",
|
||||
"web@rettentilliv.dk",
|
||||
"regnskab@rettentilliv.dk",
|
||||
"elukultuur@gmail.com",
|
||||
"info@saptk.ee",
|
||||
"presse@fondationlejeune.org",
|
||||
"info@alfa-ev.de",
|
||||
"berlin@bv-lebensrecht.de",
|
||||
"info@cdl-online.de",
|
||||
"info@datenschutz.ekd.de",
|
||||
"datenschutz@ojc.de",
|
||||
"kontakt@familien-schutz.de",
|
||||
"info@jvl-ev.de",
|
||||
"zfl@juristen-vereinigung-lebensrecht.de",
|
||||
"kontakt@familie-geht-vor.de",
|
||||
"info@agalia.org.gr",
|
||||
"kapcsolat@egyuttazeletert.hu",
|
||||
"asszonyszovetseg@asszonyszovetseg.hu",
|
||||
"info@familyandlife.org",
|
||||
"info@ionainstitute.ie",
|
||||
"info@famigliadomani.it",
|
||||
"contact@novaeterrae.eu",
|
||||
"giuristiperlavita2@gmail.com",
|
||||
"postmaster@giuristiperlavita.org",
|
||||
"webmaster@giuristiperlavita.org",
|
||||
"redazione@lanuovabq.it",
|
||||
"segreteria@lanuovabq.it",
|
||||
"inserzioni@lanuovabq.it",
|
||||
"segreteria@lamanifpourtous.it",
|
||||
"press@lamanifpourtous.it",
|
||||
"info@provitaefamiglia.it",
|
||||
"stampa@provitaefamiglia.it",
|
||||
"redazione@provitaefamiglia.it",
|
||||
"asociacijagimene@gmail.com",
|
||||
"info@schwanger.li",
|
||||
"beratung@schwanger.li",
|
||||
"info@schwanger.li",
|
||||
"af@ateitis.lt",
|
||||
"info@propatria.lt",
|
||||
"contact@moldovacrestina.md",
|
||||
"secretariaat@provita.nl",
|
||||
"info@schreeuwomleven.nl",
|
||||
"morten@menneskeverd.no",
|
||||
"kristin@menneskeverd.no",
|
||||
"maria@menneskeverd.no",
|
||||
"susanne@menneskeverd.no",
|
||||
"ingrid@menneskeverd.no",
|
||||
"sara@menneskeverd.no",
|
||||
"fredrik@menneskeverd.no",
|
||||
"bjarne@menneskeverd.no",
|
||||
"ingridbs@menneskeverd.no",
|
||||
"annekari@menneskeverd.no",
|
||||
"post@menneskeverd.no",
|
||||
"fundacja@glosdlazycia.pl",
|
||||
"biuro@mamaitata.org.pl",
|
||||
"biuro@ordoiuris.pl",
|
||||
"rzecznik@ordoiuris.pl",
|
||||
"interwencja@ordoiuris.pl",
|
||||
"f.p.p.vida@gmail.com",
|
||||
"office@alianta-familiilor.ro",
|
||||
"asociatiadiaconia@yahoo.com",
|
||||
"redactia@culturavietii.ro",
|
||||
"contact@asociatiaprovita.ro",
|
||||
"profamilia.ru@gmail.com",
|
||||
"info@familypolicy.ru",
|
||||
"info@alianciazarodinu.sk",
|
||||
"donumvitaeoz@gmail.com",
|
||||
"forumzivota@forumzivota.sk",
|
||||
"info@zavod-zivim.si",
|
||||
"info@cidevida.org",
|
||||
"forofamilia@forofamilia.org",
|
||||
"prensa@forofamilia.org",
|
||||
"prensa@hazteoir.org",
|
||||
"info@profesionalesetica.org",
|
||||
"asistencia24@redmadre.es",
|
||||
"info@valoresysociedad.org",
|
||||
"info@respektlivet.nu",
|
||||
"info@shrl.eu",
|
||||
"info@starke-muetter.com",
|
||||
"family_institute@ucu.edu.ua",
|
||||
"info@christianconcern.com",
|
||||
"press@c4m.org.uk",
|
||||
"admin@c4m.org.uk",
|
||||
"info@core-issues.org",
|
||||
"info@righttolife.org.uk",
|
||||
"information@spuc.org.uk",
|
||||
"info@spucscotland.org",
|
||||
"belfast@spuc.org.uk",
|
||||
"info@christian.org.uk",
|
||||
"info@vfjuk.org",
|
||||
))
|
||||
|
||||
# random first name
|
||||
email = random.choice((
|
||||
# ok, you got me, not so much random
|
||||
"laura", "dominika", "patrycja",
|
||||
# bromine and barium
|
||||
"andrea", "brock", "jesse", "walter", "mike", "flynn", "marie", "hank", "gustavo", "saul",
|
||||
# an edgy teenager and her friends
|
||||
"haruhi", "kyon", "mikuru", "yuki", "itsuki", "ryouko",
|
||||
# that's totally how they live
|
||||
"yuuko", "mai", "mio", "nano", "hakase", "sakamoto", "misato", "izumi", "yoshino", "haruna"
|
||||
))
|
||||
email += random.choice(("", ".", "_", "-"))
|
||||
# random a-z chars
|
||||
for i in range(random.randint(3, 9)):
|
||||
email += chr(97 + random.randint(0, 24))
|
||||
return email + "@" + random.choice([
|
||||
"gmail.com", "outlook.com", "live.com",
|
||||
])
|
||||
# ~50% chance
|
||||
if random.randbytes(1):
|
||||
# random digits
|
||||
email += compat_str(random.randint(0, 9999))
|
||||
return email + "@" + random.choice((
|
||||
# only include big corp e-mail domains here, fuck centralization
|
||||
"gmail.com",
|
||||
"outlook.com",
|
||||
"live.com",
|
||||
"hotmail.com",
|
||||
"hotmail.co.uk",
|
||||
"yahoo.com",
|
||||
"aol.com",
|
||||
"aim.com",
|
||||
"yandex.ru",
|
||||
"mail.ru",
|
||||
))
|
||||
|
||||
|
||||
def regex_search_string(regexes, string, default=None, multiple=False, whole_match=False):
|
||||
|
|
Loading…
Reference in New Issue