As a freelance blogger, I'm always searching for better tools that give me more control online. Lately, I've been exploring self-hosted apps that I can run on my own computer, allowing me to avoid big companies tracking and controlling my data on my own terms. When I discovered SearXNG, a self-hosted search engine, I got an idea: what if I could use it to create my own private version of Google Alerts? The thought of receiving updates on my favorite topics directly to my phone, without anyone else knowing what I'm following, was too good to ignore. So, I decided to try and build my very own private alert system from scratch.
Self-hosted search engine
Google, who?
SearXNG is a powerful, open-source meta-search engine. It's an incredible tool that pulls results from over 70 different search engines and services, including Google, Bing, and specialized platforms. The smart part is that it acts as a private middleman. My searches go to SearXNG first, not directly to Google or Bing. This means those companies can't track my searches or create a profile about me. I have complete control over my data.
The easiest way to get SearXNG up and running is with Docker. Docker simplifies the entire setup process by bundling the application and all its dependencies into a single, portable container. It took just a few minutes and a single command to pull the official SearXNG image and launch my private instance.
The best thing about this setup is how much flexibility I have in making changes. I can choose exactly which search engines I want to get results from. This provides me with a wider range of information and prevents me from being limited to one company's perspective on the world. I can also change the look and feel of the search page with different themes and settings to make it my own. SearXNG also allows me to search by category for items such as images, news, music, and files. And because it's running on my own server, there are no annoying ads from the big search companies. It's a quick, clean, and completely private search experience, built just for me.
A private alert system with SearXNG API
Turning search into a super-tracker
I wanted to take my self-hosted search engine to the next level. Instead of just using it for manual searches, I wanted something similar to Google Alerts that would tell me when new content related to my blog topics appeared online. I played around with the SearXNG API to build my private Google Alerts.
I wrote a simple bash script to handle this. It's not super complicated. The script utilizes the API to send a specific search query, such as "latest tech news," to my SearXNG instance. I have it set to get the results back as a JSON file, which is a common way to organize data that's easy for programs to understand.
But just having a script that runs isn't enough; I needed to get the alerts on my phone. I used KDE Connect, an open-source tool that enables your computer and phone to communicate with each other. I set it up on my computer and mobile phone, and linked them. I utilized its device ID in my bash script. After the script gets the search results, it checks for new items. If it finds anything new, it uses KDE Connect to send a push notification directly to my phone. When the script receives the results, it also saves the URLs into a simple text file, so I can refer to them in the future as well.
This system is perfect for me. I receive a simple alert on my phone whenever a relevant article is published, allowing me to check it out and draw inspiration for my next blog post. I don't have to worry about my interests being tracked or my data being sold. It's a completely private and efficient way to stay on top of my game, all thanks to my own self-hosted search engine and a bit of scripting.
I automate it with the Windows Task Scheduler
Making my system run on a schedule
Now that I had my bash script, I needed a way to run it automatically without having to manually start it every time. As a Windows user, the most straightforward solution was the built-in Task Scheduler.
I opened up a Task Scheduler and created a new task. I gave it a simple name like "SearXNG Alerts." The best part about this tool is how much control you have over the schedule. I set a trigger to run my bash script every few minutes. This means I get a continuous, real-time stream of new search results for my topics, which is perfect for a blogger who needs to stay ahead of the curve.
Inside the task's settings, I pointed it to my bash script file. I made sure to configure it to run even if I'm not logged into my user account, so it keeps working in the background. With a few clicks, my private alert system was fully automated. I no longer have to worry about missing an important update; my computer now does the work for me, and I get a simple, private notification on my phone.
Such self-hosting experiments are fun and worthy
This entire project began as a fun test to see if I could build my own private alert system. It turned out to be so much more. What I've made is a truly private and effective way to stay updated on the things I care about, all while keeping my personal data to myself. The script I wrote is pretty simple, and it works perfectly for me, but there's a ton of room for improvement. For now, this simple setup proves that taking control of your own online tools is a worthwhile endeavor that can significantly boost your productivity.
