20 lines of code to kill my Instagram Addiction
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.
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.