DEV Community

Cover image for Automate your Instagram Posts like a PRO with Cron jobs! πŸš€

Automate your Instagram Posts like a PRO with Cron jobs! πŸš€

Shrijal Acharya on August 10, 2024

TL;DR ✨ In this easy-to-follow tutorial, you will learn how to build your own Instagram Automation tool from scratch with cron jobs. 😎 ...
Collapse
 
larastewart_engdev profile image
Lara Stewart - DevOps Cloud Engineer

Wow, wow, wow β€” I love this article so much! Just following what others do is not how I define a programmer; finding an unusual way to solve real-world problems is where creativity comes in.

Who would've thought that anyone could use something as simple as a cron job to automate posting on social media?

I am definitely spinning this up on my Ubuntu server running in my homelab. Cheers to you. πŸ₯‚

Collapse
 
larastewart_engdev profile image
Lara Stewart - DevOps Cloud Engineer

To be honest, I didn't know you could create an entire image with NumPy arrays. I don't work with Python much but Wow!

Collapse
 
shricodev profile image
Shrijal Acharya

I'm glad I could share it with you. πŸ˜„ Here, we're generating an image using the Pillow library from NumPy arrays, so the image generation isn't solely based on NumPy.

Collapse
 
shricodev profile image
Shrijal Acharya

I'm glad that you liked it. ☺️

Collapse
 
shricodev profile image
Shrijal Acharya

Let me know your thoughts on this πŸ‘€

Collapse
 
heyeasley profile image
heyeasley πŸ“πŸ₯­ • Edited

Seems to be well-explained article. I think it can be applied to own social media.

Collapse
 
shricodev profile image
Shrijal Acharya

@heyeasley Glad you liked it! 😊

Collapse
 
mukesh_singhania_1992 profile image
Mukesh Singhania

You've written a complete book. 23Β min long article πŸ’€

Collapse
 
shricodev profile image
Shrijal Acharya

Hope you enjoyed reading this.

Collapse
 
mukesh_singhania_1992 profile image
Mukesh Singhania

But, I love the fact that the code is very crisp and well documented. Saving it for later.

Collapse
 
denys_bochko profile image
Denys Bochko

while it is a very good article and I am going to read it in detail shortly, I am going to ask a question about whether it will impact your account.

I was using a Mac app to view my account on my desktop and recently Instagram logged me out saying that I am using automation to view my account, which is apparently against the rules. After that, I got logged off on my mobile so I had to log back again and I could not get into that app anymore.
Just curious of there is a possibility of getting the same behaviour using this cron? Not against the automation, I am all for that, but when you deal with Meta, it's a different story.

Collapse
 
shricodev profile image
Shrijal Acharya

This shouldn't have any security complications, to be honest, as long as Instagram is happy to expose its API (and you ensure that nobody other than you can view your .env file with your username and password). Do keep in mind that the first time you try this from your system, have Instagram open in another tab, as it may ask if the device trying to access your account is indeed yours.

But make sure you don't have a post scheduled for every other minute, as it will try to log in to Instagram for each post.

Collapse
 
basspod profile image
Paul ODell

This is amazing! I love this project. But when I take a step back. What problem is it solving?

Collapse
 
shricodev profile image
Shrijal Acharya

I’m glad you liked it! 😊 It can definitely come in handy if you have a few images that you want to post on Instagram, but not right away β€” just on a certain day.

I can't say this is super useful all the time, but it can come in handy at times. After I wrote this article, I found out that Instagram offers this feature for professional accounts: help.instagram.com/439971288310029.

Not everyone would want to switch their account to professional, though. The idea of Instagram automation came to me when I built a GNOME wallpaper changer script that updates my wallpaper every 3 hours using cron jobs and decided to code it up and share with you all.

Collapse
 
basspod profile image
Paul ODell

Great work around to get the professional account feature!

Collapse
 
shekharrr profile image
Shekhar Rajput

I love the fact that you using docsttring in the documentation!

Collapse
 
shekharrr profile image
Shekhar Rajput

Almost after a week, I still see this 23 min read blog on my feed. Great to see it performing well. πŸ‘πŸ½

Collapse
 
shricodev profile image
Shrijal Acharya

Thank you πŸ˜€

Collapse
 
aayyusshh_69 profile image
Aayush Pokharel

Wow, good piece. I don't know anything about shell scripting and all.
Definitely not a beginner like me πŸ₯² friendly article . Try changing the experience level.

Collapse
 
shricodev profile image
Shrijal Acharya

I just noticed that the post experience is set to the first stage of the Advanced graph by default.

Collapse
 
bh4skar profile image
Bhaskar Prajapati

This is one big post. Bookmarking it for later. As long as you use it inside a cloud VM, this script will be a lifesaver.

Collapse
 
shricodev profile image
Shrijal Acharya

Exactly. If you plan to use this on your own computer, it should be when your computer is powered on most of the time.

If you have a cloud VM or a home lab setup, this should be a lifesaver.

Collapse
 
martinbaun profile image
Martin Baun

TIL. Interesting!

Collapse
 
shricodev profile image
Shrijal Acharya

Glad you found it helpful! πŸ˜„

Collapse
 
shricodev profile image
Shrijal Acharya

I've tried documenting portions of the code itself, so the article won't be over half an hour long.