I love automating stuff... like, I really love it—especially when it means I'll be saving tons of hours.




Come to think of it, that's the golden rule of automation:

Time Saved by Automation > Time to Build the Automation

You don't want to automate just for the sake of it, but because it provides a real benefit. Sometimes, you might not save as much time as expected, but you can still avoid dealing with painful, boring, and repetitive tasks. To put it more generally:

Benefit from Automating Tasks > Investment Required to Build the Automation

Examples of What You Can Automate

There are plenty of things you can automate:

  • Automatically fill web forms (e.g., by connecting to a Google Sheet and filling out an online form for each row).
  • Web scraping: read website content and populate a Google Sheet with the data.
  • My favorite 🪄✨: website monitoring. This is especially useful if you want to be the first in line to buy concert tickets or get an appointment for your ID, driver’s license, or passport.

The Easy Way

If you're not a developer, there are available no-code or drag-and-drop solutions that allow you to easily automate web-based tasks like the ones mentioned above. It just takes a bit of research. One tool I recommend right off the bat is the Chrome extension Axiom.ai. This extension allows you to do web scraping, automatic form filling, and connect with external tools like ChatGPT or Google Sheets.

After downloading and installing Axiom, go to the website you want to monitor or scrape and open the extension. Let’s say you want to monitor Techmeme for Apple's latest news and push the results to a Google Sheet. Open Axiom and click on "+ New Automation". Start by choosing a template—here, we'd select "Scrape links from a webpage".

   

The extension will ask you for the link of the website and prompt you to indicate the elements you want to scrape, such as all the headlines. After linking Axiom with your Google Account and Drive, run the automation, and you'll see results in your Google Sheet within seconds.


Downside: You'll have to give Axiom access to your Google Docs, and if you want scheduled workflows, you'll need a paid plan (about $15/month or more).

Other no-code solutions include Microsoft's Power Automate and Zapier. They’re easy to use and integrate with third-party apps like Google Sheets, Gmail, Slack, and more.

The Proper Way

Sometimes, dealing with government websites can be frustrating—like trying to book an appointment for an ID or passport. It’s often a waiting game, with people "stupidly lucky" enough to be at the right place at the right time. That’s not acceptable to me, so I always automate the process to notify me when appointments become available.

When I have an automated monitoring job up and running, the sense of achievement is **beyond rewarding**. I let technology work for me, and I’m first in line for the next available slot.

Here’s how I do it: I set up an AWS Lambda function to run a Python script that notifies me via email or SMS when a slot opens up. Government websites vary in how they display available dates, but you can usually handle it—unless there's a captcha or anti-bot control in place.

Before diving into automation, make sure to review the website’s Terms and Conditions to see if they prohibit automated actions.

Example: Rick and Morty Automation

To give you a practical example, let's imagine you want to get notified every time you stumble upon a dead character in the Rick and Morty universe. Using The Rick and Morty API, we can implement a simple Python script that will send a Telegram message once we retrieve a dead character. You’ll first need to set up a Telegram bot (instructions here).

import requests
import random

def send_telegram_message(message=""):
    bot_token = 'XXX'
    chat_id = 'YYY'  # Replace with your chat ID

    send_text = f'https://api.telegram.org/bot{bot_token}/sendMessage?chat_id={chat_id}&text={message}'
    
    response = requests.get(send_text)
    if response.status_code == 200:
        print("Telegram message sent!")
    else:
        print("Failed to send message:", response.status_code)

def get_random_character():
    response = requests.get("https://rickandmortyapi.com/api/character")
    data = response.json()
    total_characters = data['info']['count']
    
    random_id = random.randint(1, total_characters)
    character_response = requests.get(f"https://rickandmortyapi.com/api/character/{random_id}")
    character_data = character_response.json()

    name = character_data['name']
    status = character_data['status']

    if status == 'Dead':
        send_telegram_message(f"The character '{name}' is dead.")
    else:
        send_telegram_message(f"The character '{name}' is {status.lower()}.")

def lambda_handler(event, context):
    get_random_character()

if __name__ == "__main__":
    get_random_character()

Next, you’ll deploy this as an AWS Lambda function. While Lambda is usually straightforward, issues can arise with libraries that your script depends on, so you may need to package your code in a Docker container.

Setting up Docker for AWS Lambda

Create a Dockerfile with the following content. In the same folder, have your lambda_function.py and requirements.txt:

FROM public.ecr.aws/lambda/python:3.12

COPY requirements.txt ${LAMBDA_TASK_ROOT}
RUN pip install -r requirements.txt
COPY lambda_function.py ${LAMBDA_TASK_ROOT}

CMD [ "lambda_function.lambda_handler" ]

Build the container with this command (make sure Docker is installed on your system):

docker build --platform linux/amd64 -t ricknmorty:test .

Run the container to test it:

docker run --platform linux/amd64 -p 9000:8080 ricknmorty:test

To invoke your Lambda function, use this command:

curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'

If successful, you’ll get a Telegram message with the name and status of a random character!

Deploying the Docker Image to AWS

Once your image works, you can push it to AWS ECR and create your Lambda function. Follow this guide for detailed instructions.

Creating the Lambda

At this stage, creating the Lambda is pretty straightforward. Here’s what you need to do:

  1. Open AWS Lambda from your AWS Console.
  2. Click on "Create Function".
  3. Select the "Container Image" option.
  4. Give your function a name.
  5. Browse for the container image you uploaded earlier in the ECR repository.
  6. Click "Create Function" to finalize the process.


Once your Lambda function is created, you can connect it to an Amazon EventBridge event to schedule when it runs. For example, you can set it to check for updates every 15 minutes. That way, your Lambda will keep monitoring without you having to lift a finger.


Conclusion

This isn’t just about Rick and Morty; it’s about automating your life. In just a few hours, I was able to automate tasks that used to consume hours of my time. More importantly, automation frees you from the mental load of having to remember to check websites—plus, you get to be first in line for available appointments or tickets... or whatever the heck you need. As for the cost of running this Lambda function? It's virtually free (around $0.006 per month).

You can check the GitHub repo with all the code here: https://github.com/thecodebeatz/ricknmorty