En Reddit, un redditor es el término dado a un usuario. Reddit le pide a cada usuario que verifique su cuenta después de registrarse con una cuenta. Aquí veremos cómo verificar si un redditor ha verificado su correo electrónico o no. Usaremos el has_verified_email
atributo de la Redditor
clase para verificar si un redditor ha verificado su correo electrónico o no.
Ejemplo 1: Considere el siguiente redditor:
El nombre de usuario del redditor es: spez.
# importing the module import praw # initialize with appropriate values client_id = "" client_secret = "" username = "" password = "" user_agent = "" # creating an authorized reddit instance reddit = praw.Reddit(client_id = client_id, client_secret = client_secret, username = username, password = password, user_agent = user_agent) # the name of the redditor redditor_name = "spez" # instantiating the Redditor class redditor = reddit.redditor(redditor_name) print("Has " + redditor_name + " verified their email? : " + str(redditor.has_verified_email))
Producción :
Has prez verified their email? : True
Ejemplo 2: Considere el siguiente redditor:
El nombre de usuario del redditor es: AutoModerador
# importing the module import praw # initialize with appropriate values client_id = "" client_secret = "" username = "" password = "" user_agent = "" # creating an authorized reddit instance reddit = praw.Reddit(client_id = client_id, client_secret = client_secret, username = username, password = password, user_agent = user_agent) # the name of the redditor redditor_name = "AutoModerator" # instantiating the Redditor class redditor = reddit.redditor(redditor_name) print("Has " + redditor_name + " verified their email? : " + str(redditor.has_verified_email))
Producción :
Has AutoModerator verified their email? : True