I’m happy to write this post. This post is for present you the first real project that I’ve done with Java…with a real application.
After spend my time learning Java SE and SQL at my studies (and differents online courses), I’ve decided to start and finish a project in a short period of time, to test the concepts learned and scheudle the project in the timeline to start and finish it.
It was important for me that the project were simple and functionality. Normally, I have great ideas to develop, but these ideas are difficult and take a lot of time for one simple person. So, this time, it were important for me the start a simple project, with a real application that I could finish in a few weeks.
So.. here you have the first element of my portfolio in JAVA: Stoibot.
Technologies: Java, MySQL and Twitter4j library
Started: Feb 12, 2022
Finished: Mar 2, 2022
Stoibot it’s a application to tweet every day, at the same hour, a random quote from a stoic author. It’s really simple. The idea came to me when I was reading differents books of philosophy, specially author as Séneca and Marco Aurelio. I found in theirs lines differents ideas that it helps me in hard moments. So, I’ve thought that it could be a good idea share these ideas for the rest of the world (and twitter, of course).
To take real my plan and create my first JAVA project, I thought in create a bot based in JAVA + MySQL + API of Twitter. What was the result? The Stoibot.
I would describe the internal functioning, but you have all the code published in Github, so you can check it, it’s very simple: I’ve used Object Oriented Programming, the MySQL connector JBDC, a simple MySQL database with 3 fields and an interesting library called Twitter4j who helps you to use the Twitter API.
All the program runs with a infinite loop who are running while the program doesn’t find an error. Once the script send the Tweet, it sleeps the script until the next day. With this method, I mantains the processor free of operations.
All the quotes were inserted by me. Right now, I have more than 400 quotes from differents authors, so we have a variety of very interesting quotes.
The script is running in a Raspberry Pi 3 who host the MySQL server too. All very simple, the script, the system and the philosophy… like a good stoic would do!
Wich problems have I found? About the code… nothing. But I have needed to ask a Elevated account for the API Twitter. This request has delayed the project two weeks more but, surprising, when I had it, the script works fine at the first attemp!
So.. thanks for reading and check my first JAVA project! If you have some question, you could ask it in the comment box and I’ll check it!
I hope write soon about the next project!