Automating Trivial Tasks
Over a year ago, I was working at a company that required the employees to do trivial tasks at a daily basis.
Two of the most annoying things that they have us do is: message our chat group “good morning”, “good evening”, “lunch”, or “out” and the other was log every single thing in Basecamp (scrum, training, tasks).
Mind you, I didn’t have much projects here, so the instruction there was, to just put
Training > <insert thing to train about here>
Now I hate doing repetitive things. Especially when it takes so much of time and it takes you out of your zone. So, why not have a bit of fun with it right?
Skype
Good Morning, Good Evening, Good Night
First thing I had to take care off was sending messages on Skype.
I always forget it was kind of a big deal if you didn’t send a message.
The idea was:
- Detect if my laptop woke up from sleeep.
- Check if the wifi is the <office wifi>
- Open Skype
- Send a message based on the time “morning”, “afternoon”
- Throw in some variety like: “hey!” “heya!”, “what’s up errone! :D” just to give the illusion that I was actually the one typing it.
One gotcha was, I had to make sure that the script won’t send another message once I’ve turned my laptop back on. Nothing a small file cache of the current date can’t fix.¯\_(ツ)_/¯
Be Right Back, Lunch, Back, and Out
I use vim and emacs as my editors. I’m pretty much used to having to work at my terminal, so having to switch back between applications can become quite cumbersome.
In hindsight, past me was being a whiny douche for complaining about typing “out” before leaving.
Although, I dunno, it just feels so fabricated having the chatroom being filled with “good am”, “good pm” “lunch” “out” “brb” without having actual conversations.
I love talking to people but feigning a conversation doesn’t feel productive at all.
So, building on top of the Skype script, typing work brb would just send a variety of messages to the group chat!
Now it gets a bit more fun.
Basecamp
At the time, the company was using Basecamp v1 and we were required to log every single bit. The way we logged was a bit relaxed at the time but, it could be better to have a bit more detail.
On the first few months, I didn’t have much to do so I had to log training hours. I did code some freelance, or some open source projects, I needed a bit more variety in my logs.
So what the script would ultimately do:
work time:logwould give you a preset of a randomized log of any training from Laravel, Vue, Design, User Experience- Add the hours but default to the remaining hours.
Another thing that it did was just split the whole 8 hours into random chunks and add some training time on it. Saves so much time at the end of the day!
The Time Projects Came
Now, there were times that I were thrown in a project that I had to log some hours, and had some scrum session things.
For that work scrum halts progress in my terminal session which starts the timer, then once I terminate the script, it’ll just do some time math and push up the scrum time to basecamp.
On the coding part, I didn’t want to log every single task and look back at my logs just to see what I did.
I added a .work file in every project and a .workrc on my $HOME directory to have some customizability on where it’ll send the data.
Next, I added a work init command which adds .work on my .gitignore file and added a git hook that pushes that commit to basecamp.
From that, I make the bosses happy with detailed commits, and me less hassled with all the procedures.
The Point?
I don’t know really, I just really had quite a but of fun with that so I wanted to write about it.
I guess something to take out of it is, if you have to do it over and over again, just automate the fuck out of it.
On the next job I had, I also automated building my reimbursement reports for my transportation receipts with Dusk, ’cause who has time to compile all that stuff right? ¯\_(ツ)_/¯
That evolved the script into my calendar alarm triggering a small web app to start paying my bills across different websites, but that’s another story.
