From PhD to OnlyFans: Building a Raspberry Pi Notification Robot
Computer scientist Zara Dar left her PhD to run a lucrative OnlyFans business and created a Python‑based Raspberry Pi notification robot that alerts her to new subscribers with a moving 3D‑printed penguin and sound playback.
Zara Dar, a computer science master’s graduate who abandoned a PhD to run an OnlyFans business, earned over $1 million and paid off her mortgage.
She continues to produce STEM content on YouTube while sharing a GitHub project called OnlyFans‑Notification‑Robot, a Python script that runs on a Raspberry Pi.
The script monitors Gmail for new OnlyFans subscriber emails; when one arrives it triggers a stepper motor to move a 3D‑printed penguin and plays a sound via pygame.
Key components include RPi.GPIO for motor control, imaplib for email access, and pygame for audio playback. The code continuously checks the inbox every 20 seconds and cleans up GPIO on exit.
import RPi.GPIO as GPIO
import time
import imaplib
import email
import pygame # import pygame library
# define the pins that will connect to the stepper motor driver
pin_seq = [17, 18, 27, 22]
GPIO.setmode(GPIO.BCM)
for pin in pin_seq:
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, False)
step_seq = [
[1, 0, 0, 1],
[1, 0, 0, 0],
[1, 1, 0, 0],
[0, 1, 0, 0],
[0, 1, 1, 0],
[0, 0, 1, 0],
[0, 0, 1, 1],
[0, 0, 0, 1],
]
def step(index):
for pin, value in zip(pin_seq, step_seq[index]):
GPIO.output(pin, value)
USERNAME = '[email protected]' #replace with your email
APP_PASSWORD = '000000' # replace with your app password
MAIL_SERVER = 'imap.gmail.com'
SENDER_EMAIL = '[email protected]' #replace with the email account you want to receive a notification from
pygame.mixer.init()
sound = pygame.mixer.Sound("sound.wav") #replace with the name of the audio file you want to play
def check_email(user, app_pwd, mail_server, sender):
mail = imaplib.IMAP4_SSL(mail_server)
mail.login(user, app_pwd)
mail.select('inbox')
result, data = mail.uid('search', None, '(FROM "{}" UNSEEN)'.format(sender))
mail_ids = data[0]
if mail_ids:
email_ids = mail_ids.split()
latest_email_id = email_ids[-1]
mail.uid('store', latest_email_id, '+FLAGS', '(\Seen)')
sound.play()
for _ in range(512*4):
for i in range(len(step_seq)):
step(i)
time.sleep(0.0007)
while True:
check_email(USERNAME, APP_PASSWORD, MAIL_SERVER, SENDER_EMAIL)
time.sleep(20) # check every 20 seconds
GPIO.cleanup()GitHub repository: https://github.com/zaradarz/OnlyFans-Notification-Robot and her X profile: https://x.com/zaradarz/.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
