20 lines of code to kill my Instagram Addiction

from Unsplash

The application is designed in a way to keep you hooked up for long hours. The urge to keep checking the new feed, the novelty for any new update is just irresistible.

On monitoring my past few days time wasted on Instagram, I realized that I was wasting well over 2+ hours daily and I seriously need to cut this time to less than 30 mins. So now we have our problem, lets begin with the solution part.

Target Solution :- I need someone/something to close my tab once the predetermined time limit is up. (I can assume that once the tab is automatically closed, I am not going to reopen it immediately, even deep down I also want to close the tab)

Requirements :- python -version 3.6+, selenium webdriver(for automation), and some bunch of internal libraries we’ll be using

OK, enough of the talk, lets walk through the code.

The image from my git hub

So, what it actually does?

It opens up Instagram in a new automated chrome window. With the wait times in place, it logs in my account with the credentials provided aaaannnnddddd…….. well wait… It also turns down the Instagram’s request’s for popping up desktop notifications and here’s my instagram page.

Well shit… I’ve made logging in even easier and hassle free. Now I’ll waste even more time on Instagram. I need some controls.

So I have automated scrolling for my feeds. At every 3 seconds PageDown button will be pressed and it’ll keep on running till just 5 mins(that’s what I have decided for me). You can change your own time.

The code is kind of crude, but it works!!! You can find the code following my GitHub link.

After 5 mins of mindless scrolling, the browser window closes and I am left with the question to life, universe and everything.

Reader, dreamer, explorer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Benchmark Elastic-Search vs Raven-DB for Reading collections of data in .Net Core:

DevOps- Super simplified with my DosaOps story:

Max & Min Depth of BST

Metawork Is Taking The Guesswork Out Of Programming

Spotlight: Adriana is the link between the user and powerful RegTech tools

How To Use Update Statements In PHP/SQL

Backing Up My Logic Pro Projects to AWS S3 (Part 1)

Theory of Constraints — The Goal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gaurav Kumar

Gaurav Kumar

Reader, dreamer, explorer.

More from Medium

First, we have to distinguish and elaborate what is the primordial essence of a 'word’.

Fake News: Vegetarians Eat Meat When Drunk

💼Very soon, S-Wallet will offer the possibility of USDT / USDC loans, which we announced in the…

From Best Dressed To Best Fêtes! All The Coachella Buzz You Missed This Weekend — Daily Front Row