How I Built a Daily Motivation Bot Using Web Scraping and GitHub Actions
- Srividya Sundaravadivelu
- Apr 29, 2025
- 5 min read
There’s something about starting the day with the right mindset. A spark of inspiration can change how you approach everything. I used to look up motivational quotes manually each morning, until I thought - Why not build a bot that does this for me, and send it to my email daily?
Like many, I wanted to build a positive habit — starting my day with a motivational quote. But I found myself opening random quote websites and getting distracted. I also end up skipping the habit altogether, some days. So, I solved this problem once and for all by automating it!
My initial idea was to use a quotes API to get a random motivational quote emailed to me daily. But that sounded too straightforward. I was introduced to web-scraping recently and wanted to explore it more. So, I thought, why not scrape a motivational quotes website, extract quotes, and schedule it to run automatically, so that it emails me a quote every day, without me touching it. That was how my Daily Motivation Bot was born. This sounds a little unusual, but this project became a fun way of exploring web-scraping and scheduling.
What is Web Scraping?
Before I dive into my Daily Motivation Bot using Web Scraping, let me explain briefly what web scraping is. Web Scraping involves sifting through the pages of a website to extract the required information in the said format using code. For example, if I want quotes and authors from a motivational quotes website, I could write a program to scrape through the website, extract all the quotes and authors, and store them in a database or a file.
Choosing the right website
Web scraping comes with some legal issues. Not all websites allow web-scraping. Some prohibit it altogether, and it will be mentioned in their terms of service. We may get into trouble if we violate the website's terms of service. So, we must be careful about what content we extract from the website.
So, how do you know if a website allows web-scraping?
Many websites contain a Robots.txt file, which includes information on which parts of the site can be accessed and scraped. I came across BrainyQuote, a website for inspirational quotes. I liked the website and wanted to use it for my web-scraping project. Before starting, I checked if the website allows web-scraping or not. To determine this, I referred to the Robots.txt file by visiting brainyquote.com/robots.txt. The Robots.txt file for Brainy Quotes contains a section for web scrapers and crawlers. I reviewed the terms of service mentioned in that section. It was specified that the website doesn't allow any scraping.

That was a disappointment for me. So, I continued to look for other websites that don't prohibit scraping. I finally discovered the Quotes to Scrape website. This website was explicitly created for web-scraping practice. I navigated to quotes.toscrape.com/robots.txt to check if the website has any restrictions. No Robots.txt page was found for this site. This means the site has no restrictions on web scraping. Now I am all set to start with scraping!
Here is the list of tools I used for my Daily Motivation Bot project:
Selenium Java | Web scraping and sending the email |
Gmail App Password | For secure email sending |
GitHub Actions | Running the bot every day automatically |
Eclipse | IDE for Java |
Now, let us see in detail how I built my Daily Motivation Bot:
Step 1: Scrape Quotes from Quotes to Scrape website
Using Selenium with Java, I scraped all the quotes from the Quotes to Scrape website. I navigated to the website and located all elements with the class name "quote". I extracted each quote's text and author by finding the relevant child elements inside the quote div. Also, I handled pagination by clicking the "Next" button until all the pages were visited. In this way, I collected all the quotes from the website. I was able to collect a total of 100 quotes, along with their authors.

After I have extracted the quotes from the website, I select a random quote to be emailed. Here is the GitHub link to the complete source code for my Project: https://github.com/srividya-sundaravadivelu/DailyQuoteBot.

Step 2: Generating a Gmail App Password
My next step is to write code to email the quote to myself. For that, I used my Gmail credentials. I used Gmail App Passwords for secure login since I cannot use regular passwords. I navigated to my Google Account and created a new App password.

Step 3: Securing Credentials with GitHub Secrets
Now that the App Password is created, I need to be careful not to expose it in my code. To secure sensitive information like email addresses and passwords, GitHub provides a secure method called "Secrets".
I added the variables EMAIL_USER and EMAIL_PASS to my GitHub Secrets. These variables are encrypted and can be accessed securely within GitHub Actions workflows.
You can find this under: GitHub → Settings → Secrets and variables → Actions.

Step 4: Email the Quote
After I secure the credentials using GitHub secrets, I can refer to them in my code as environment variables without directly exposing them. The screenshot below shows the code snippet for sending an email.

Step 5: Automate with GitHub Actions
Finally, I set up a GitHub Actions workflow to run this script every day without lifting a finger. I created a YAML file under .github/workflows. I scheduled my workflow to run daily at 9.00 AM CDT (14:00 UTC). Here is the screenshot of daily-quote-workflow.yml.

And That’s It! Every morning at 9:00 AM CDT (14:00 UTC), the workflow runs automatically and delivers a motivational quote to my inbox.

Let's examine the GitHub Actions workflow to see how everything works behind the scenes.
The Actions tab shows all the workflow executions. Each workflow also indicates a status: success or failure. These statuses give an insight into how the workflow ran and if there were any failures.

We can see all the steps executed in the workflow by clicking on one of the workflows. Clicking on the arrow ">" button shows the complete details of these steps.

The "Run DailyQuoteBot" step executes the core functionality of the Daily Motivation Bot. It compiles and executes the Java program for the Daily Motivation Bot. The screenshot shows that a total of 100 quotes have been scraped. From these 100 quotes, a random quote was selected and emailed successfully.

This small project helped me experiment with web-scraping. Along the journey, I learnt how to use Selenium Java and GitHub Actions for web scraping and scheduling. I also learnt valuable insights like how to use web-scraping ethically by respecting website policies. Most importantly, it helped me start my day with a positive mindset. After all, “Just one small positive thought in the morning can change your whole day." — Dalai Lama.


