Python

Be lazy

Don’t get me wrong. I mean more productive and beneficial type of laziness.

Problem

About one year ago a friend of mine showed me this website: http://www.packtpub.com . Packt Publisihing is an online store selling IT books. It offers one free book each day. You just have to click a button on their website. I’ve been doing that every day for some time. Then I realized that I wasted too much time doing that so I come up with the solution.

Solution

I have a Raspberry Pi 3 connected to my TV. With OSMC installed, it acts as media center. It is connected 24/7 to a power supply, so why it couldn’t click that button for me? I’m programmer so that’s not a problem! I’ve used python to write a simple script which task is to log in and get free book. Then I’ve scheduled it to be executed everyday at 12:00 using cron tasks. It took me few hours (that was my first touch with python) and job was done. Now I have dozen of books on my packtpub account ( and still didn’t read even one 😉  ).

It’s interesting how many everyday tasks can be automated using a simple program. Maybe you should write your own?

2
Leave a Reply

Please Login to comment
  Subscribe  
newest oldest most voted
Notify of
panlukaszk
Guest

I like it, were you using Scrapy or some simpler libraries?