DEV Community

0x3d Site
0x3d Site

Posted on

12 2 2 2 3

🕵️‍♂️ I Made a Python Script That Spies on My Own Internet Behavior

GET A 50% DISCOUNT—EXCLUSIVELY AVAILABLE HERE! It costs less than your daily coffee.


I wanted to learn something new in Python…
But I was tired of todo apps and weather scrapers. So I asked myself:

“What if I built something that watches me? Like, actually tracks my digital habits, not to judge—but to inform me how weird I really am online.”

So I did.

I made a Python script that:

  • Tracks which websites I visit
  • Logs my mouse activity
  • Records how much I type vs scroll
  • And sends me a creepy daily summary at 10PM that says:

“Hey, you spent 2.3 hours on Twitter and typed 1,489 words in VS Code. You clicked 239 times but didn’t commit anything.”

Yeah. That kind of spy.

Let me show you how I built it—and how you can tweak it to watch yourself or your friends (ethically, of course 😅).


🧰 Step 1: Tracking My Active Window

To start, I used pygetwindow and pywin32 to grab the currently focused window every few seconds.

pip install pygetwindow pywin32
Enter fullscreen mode Exit fullscreen mode
import pygetwindow as gw
import time

while True:
    window = gw.getActiveWindow()
    if window:
        print(f"Using: {window.title}")
    time.sleep(3)
Enter fullscreen mode Exit fullscreen mode

I now had a live feed of what app or site I was staring at every few seconds.

Pair this with a good logging system, and suddenly your script has memory. I stored all these titles with timestamps into a simple SQLite file.


🐭 Step 2: Spying on My Mouse and Keyboard

I wanted to know when I was working versus when I was doomscrolling. So I tracked interaction.

pip install pynput
Enter fullscreen mode Exit fullscreen mode
from pynput import mouse, keyboard

clicks = 0
keys = 0

def on_click(x, y, button, pressed):
    global clicks
    if pressed:
        clicks += 1

def on_press(key):
    global keys
    keys += 1

mouse.Listener(on_click=on_click).start()
keyboard.Listener(on_press=on_press).start()
Enter fullscreen mode Exit fullscreen mode

Now I had a real-time counter. Bonus: it felt like I was building a keylogger… for myself.

If you're doing something sneaky like this (for good), check the latest discussions on ethical scripting. They’re full of gold.


📊 Step 3: Making a Creepy Daily Report

Every night at 10PM, I wanted a message. Not an email. Not a log file. But a cold, robotic whisper.

So I installed pyttsx3 for text-to-speech:

pip install pyttsx3
Enter fullscreen mode Exit fullscreen mode
import pyttsx3

def say_summary(clicks, keys, top_sites):
    summary = f"You clicked {clicks} times, typed {keys} keys. Top sites: {', '.join(top_sites)}."
    engine = pyttsx3.init()
    engine.say(summary)
    engine.runAndWait()
Enter fullscreen mode Exit fullscreen mode

Creepy? Yes. Motivating? Even more so.


📅 Step 4: Scheduling the Madness

I used schedule to run the report nightly.

pip install schedule
Enter fullscreen mode Exit fullscreen mode
import schedule

schedule.every().day.at("22:00").do(lambda: say_summary(clicks, keys, top_sites))
Enter fullscreen mode Exit fullscreen mode

Now my computer speaks to me every night like some kind of productivity ghost.


🧪 Bonus: Visualize It Like a Hacker

For extra flair, I added terminal charts with termgraph.

pip install termgraph
Enter fullscreen mode Exit fullscreen mode
# log.csv = scrolls, clicks, keys
termgraph log.csv --color green yellow red
Enter fullscreen mode Exit fullscreen mode

It looked like I was running a spy operation from 1996. Loved it.


🧠 Why This Was Worth It

This project gave me:

  • An actual idea of how I waste time
  • Some control over my digital habits
  • And way too much fun doing something slightly mischievous with Python

It also made me explore lesser-known libraries, terminal tools, and how to track behavior in real time.

Want more weird builds like this? python.0x3d.site is where I keep finding funky inspiration:


🤖 Build Your Own Spy

If you’re bored of the usual Python tutorials, try this. Spy on yourself. Learn from it.
And maybe—just maybe—you’ll finally uninstall Twitter.

Or not. I’m not judging.
My script is. 😏


🎁 Download Free Giveaway Products

We love sharing valuable resources with the community! Grab these free cheat sheets and level up your skills today. No strings attached — just pure knowledge! 🚀

🔗 More Free Giveaway Products Available Here

We’ve got 20+ products — all FREE. Just grab them. We promise you’ll learn something from each one.


💼 Actionable Kits & Resources to Build Your Business Faster

Explore the full shop here: Visit 0x7bshop on Gumroad


Turn $0 Research Papers into $297 Digital Products

🧠 Convert Research Papers into Business Tools The Ultimate Shortcut to Building Digital Products That Actually MatterMost people scroll past groundbreaking ideas every day and never realize it.They're hidden in research papers.Buried under academic jargon.Collecting digital dust on arXiv and Google Scholar.But if you can read between the lines —you can build something real.Something useful.Something valuable.This is not another fluffy eBook.This is a system to extract gold from research……and turn it into digital tools that sell.Here's what you get: ✅ Step-by-Step GuideLearn how to find high-impact papers and convert them into cheat sheets, prompt packs, and playbooks. ✅ Plug-and-Play ChecklistNo thinking required. Follow the steps, build your product, publish it. ✅ ChatGPT Prompt PackGet the exact prompts to decode complex research, turn insights into product formats, and even write your sales copy. ✅ Mindmap WorkflowA visual blueprint of the whole process. From idea to income — laid out like a circuit. Why this matters:Most people are drowning in low-quality content.You’re about to do the opposite.You're going to create signal — not noise.You’ll build products that are: Research-backed Fast to create High in perceived value And designed to help people win It’s a full loop: You learn → You create → Others win → You profit.What happens when you buy?You’ll feel it.The clarity.The power of execution.The momentum of turning raw knowledge into real-world value.You’re not buying a file.You’re buying a shortcut to products that earn, not just exist.If that excites you — let’s get started.No code. No waiting. Just results.👉 Grab your copy now.

favicon 0x7bshop.gumroad.com

Take ideas from research papers and turn them into simple, helpful products people want.

Here’s what’s inside:

  • Step-by-Step Guide: Go from idea to finished product without getting stuck.
  • Checklist: Follow clear steps—no guessing.
  • ChatGPT Prompts: Ask smart, write better, stay clear.
  • Mindmap: See the full flow from idea to cash.

Make products that are smart, useful, and actually get attention.

No coding. No waiting. Just stuff that works.

Available on Gumroad - Instant Download - 50% OFFER 🎉

Tiugo image

Modular, Fast, and Built for Developers

CKEditor 5 gives you full control over your editing experience. A modular architecture means you get high performance, fewer re-renders and a setup that scales with your needs.

Start now

Top comments (0)