How I setup an Instagram Bot after 6 months of studying Python.

Desmond Beramendi
Chatbots Life
Published in
4 min readApr 10, 2017

--

I have spent roughly the last 6 months teaching myself Python on the weekends(~4–6 hours) and after work (~2 hours). I used YouTube tutorials, LearnPythonTheHardWay, CodeAcademy, Udemy, and miscellaneous e-books — all free.

Then I took a step back and evaluated my progress. I thought to myself:

  1. I have a firm understanding of functions, loops, dictionaries, lists, etc.
  2. I have a solid understanding of the syntax and format of Python code.
  3. I am comfortable working in the Terminal.

I quickly realized that while I have gained solid understanding of Python I still have nothing tangible to show for it. I couldn’t show my friends or family anything aside from some terminal short cuts.

Example: “Woah dude, you can create a file within this small white box? What’s it called again? Oh the terminal? Niiicee.”

I was eager to apply some of my limited Python knowledge. I was also not delusional and knew that I couldn’t build my own script from scratch. Instead I searched the web for Python projects. I initially came across articles describing Twitter bots built using Python. On the day I was starting to research more about Twitter bots I stumbled upon this article:

I felt like this was my ‘a-ha’ moment. I’m very active on Instagram as a member (over 40,000 followers) and wanted to see if this could produce real results like the headline said. At the same time, I wanted to put my limited Python knowledge to use.

So I read the article 3 times. I clicked on the GitHub page. I’ve never been on GitHub so it was a new land for me to explore. I signed up. I clicked on all the files for InstaPy. I recognized the functions in this file, saw dozens of variables, commas separating arguments. I felt like I was warming up to this GitHub land.

Then a dozen questions started popping in my head, like popcorn kernels:

How do I run this? Do I copy and paste? Do I have permission to copy and paste? What is chromedriver? How do I install it? What the hell is Selenium? Do I have to install that too? Is there a particular order I need to install these things? How do I stop the script once I get it running?

So what did I do?

I literally googled my way thru this project.

I read everything on the GitHub page over and over. I googled everything I did not understand. I am not shitting you when I say I googled everything. I googled ‘pip install’ to better understand what ‘pip’ is. I googled ‘chromedriver’ and read the documentation. It didn’t make 100% sense to me but I still read it. I googled ‘git clone’ and was amazed that you could make a copy of the code on the GitHub page to your local computer (i’m sure the novelty will wear off). I continued swinging my google-sword and I googled every error the terminal gave me — the most annoying error I encountered was “ValueError: Attempted relative import in non-package”.

Do you get my point yet?

Anyone with a solid Python understanding of the basics can setup and run this Instagram bot. All you really need is the patience to google the shit out of everything you don’t know. I ran my bot twice today and plan on tweaking it and keep it running for a couple of months.

Please feel free to leave comments/suggestions/projects down below!

(Project Credit: InstaPy by Tim Grossmann)

--

--

I work and play with HTML, CSS, JavaScript. Making websites/web apps, & content for brands and SMB's.