Member-only story

The Real Reason To ‘Learn To Code’? Automating Your Life

On the joys of writing scripts that do scut work

Clive Thompson
Debugger

“Robotic arm” by Dan Ruscoe

Last night I automated the tip of my index finger.

I was getting super annoyed by an infinite-scrolling site. I generally hate those: I’m a journalist, and every so often I’m a) doing research that b) requires me to go back several weeks, months or years on c) an infinite-scrolling site. So I have to sit there hitting “page down” or “end” over and over again.

Last night I had to do that at a couple of sites, and after a few minutes I got bored and decided: Screw it, I’m gonna automate this.

So I wrote a quick, tiny script using the programming language Python. The script does one simple thing: It hits the “end” button on my keyboard, waits two seconds, then hits it again. Here’s what it looks like …

Utterly simple! But it did the job. I started it running, flipped over to the site I was reading, and let the script hit “end” over and over, paging downwards and downwards, while I, like, mixed myself a…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (11)

Write a response

Nice read Clive. Almost thou persuadist me to learn coding. Instead I read the article to my 18-year-old to encourage him to keep coding to make his (and my) life easier.

Office automation is the computer version of Tom Sawyer fence-painting. Program the software to do the boring and repetitive task for you! It's very satisfying. My first "programming" language was WordBasic back in the Word 2.0 days in the early…

Clive - I hope your writing tempts many to have a go. Seeing a program - even a simple "hello, world!" print statement in action - is empowering (and +1 for suggesting Python).
They key to learning is one need a reason - an irritation or a desire…