Launching a bot to drive organic social growth on FB, IG, or Twitter

Kumar Vidit
Geek Culture
Published in
6 min readMay 23, 2021
Bots Bots Everywhere (Source: https://www.majorel.com/)

The success of Facebook, Instagram, and Twitter gave birth to the concepts: social media influencers and influencer marketing. Be it — fitness coaches on Instagram or corporate professionals on LinkedIn, people are racing towards increasing their audience and followers. The most successful Instagram influencers get paid in millions for their single post by companies looking to promote their products. The LinkedIn ones catch the eyes of recruiters from top firms such as Google and Microsoft for a job offer with a huge salary. The influencers drive organic social growth in followers by continuously commenting and posting on these platforms. Automating these actions using a bot to drive exponential organic growth can get these influencers their next competitive edge in the game.

Who will benefit most from the BOT?

Instagram is a social media powerhouse. 89% believe that it is the most important channel for influencer marketing¹. Instagram outshined FB, YouTube, and other platforms because of the ease of sharing pictures — that enabled influencers to reach niche audiences.

Source: Mediakix.com

There are 500K active influencers on Instagram, as per research by InfluencerDB².

Source: Mediakix.com

Influencers with >50K followers — Mid, Macro, and Mega category Influencers — have sufficient followings and engagement for their posts. 435K Nano and Micro Instagram influencers will immediately benefit the most from the bot’s help .

The Backbone of the BOT

Selenium: A framework to automate web application testing. It consists of a suite of tools, including Selenium IDE, WebDriver, and Selenium RC.

Selenium WebDriver:

A set of APIs for interacting with web browsers and automating the user actions on browsers.

Selenium WebDriver Architecture:

Architecture of Selenium WebDriver (Source: Edureka)

> Selenium Client Libraries

Selenium support multiple languages such as Java, Python, and others. The code for the BOT is written using these languages.

> JSON Wire Protocol Over HTTP

It facilitates the communications between the browser and the code in Selenium. The protocol uses a RESTful API for providing a transport mechanism and defining a web service over HTTP.

> Browser Drivers

The Browser driver communicates with the corresponding browser. When a driver receives a command, the command is executed on the browser, and the response will be sent as an HTTP response.

> Browsers

Selenium supports multiple browsers such as Firefox, Chrome, IE, Safari, etc.

Six Simple Steps to Splendour

Steps for automating web interactions (Source: Image by author)

Let’s implement the steps to automate the login process on Instagram:

  1. Create a WebDriver instance.

To create an instance of the Firefox driver, we can use the following commands:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
WebDriver driver = new FirefoxDriver();

2. Navigate to a Web page.

To navigate to a given website, say Instagram, we can use the following command:

driver.get(“https://www.instagram.com/");

3. Locate the HTML element

To interact with a web page, one needs to figure out the location of the HTML elements on the web page — honestly, the hardest part.

Go to the element on the website, right-click, and select inspect. It will look something like this:

Inspecting webpage. (Source: Image by author)

Now, let’s grab locators for these web elements. The method to do so is:

driver.findElement(By.X(“Y”));

X can be (but not limited to):

ClassName: uses a class attribute to identify an object.

ID: to identify elements by using the ‘ID’ attribute.

name: Name attribute can also identify an element

tagName: using a HTMLtag to locate elements

xpath: Xpath is used to query a XML document. It can help identify the web elements on webpages.

Y is the value you see while “inspecting the webpage”

When X and Y are identified, the code lines will look like:

WebElement usernameElement = driver.findElement(By.name(“username”));WebElement passwordElement = driver.findElement(By.id(“password”));WebElement loginElement = driver.findElement(By.name(“login”));

4. Perform an action on the element.

After successfully identifying the elements, interact with them by invoking a method on an instance of the WebElement interface. Some methods are:

The sendKeys method to enter text

The clear method to clear text

The click method to click the button

usernameElement.sendKeys(“XYX”);passwordElement.sendKeys(“ABC”);loginElement.click();

5. Anticipate browser’s response

When the login button is clicked, wait a few seconds for your action to reach the server and allow the server to respond. The waiting time is crucial because, otherwise, the bot might fail as the elements for the next step aren’t loaded in the browser.

While there are multiple methods to do so, we will use the most convenient one: Implicit Wait.

driver. implicitly_wait(10)

6. Conclude

The quit method quits the web browser, web driver server, and releases driver.

driver.quit();

You can make the bot to perform other advanced actions such as following another user, commenting on a post, and liking a post.

Value Proposition

Apart from saving a lot of time and organically growing followers, below are the benefits of using social media bots:

> Creating your brand awareness

Getting organic followers creates your brand awareness and improves the chances of generating leads and conversions — which is invaluable for a CEO of a startup. One can redirect followers from his/her social media account to visit their business site.

> Real and engaged followers

Buying followers on social media is no good. You are buying fake accounts that create no user engagement. Bots attract real people and will enable you to reach active people in your domain, promoting user engagement.

> Become an influencer, if not already

Gain a significant number of real followers → Companies start to notice → Request you to promote their product → You gain credibility significantly, and your brand becomes trustworthy → Attracting more followers henceforth.

The Dark truth

The bot can ease some effort. But it will not solve all your problems. And, it will create some new ones:

> No customization

You can make the bot comment differently on different posts. However, comments will still be from a finite set that you created and will lack customizations that people prefer.

> Negative PR

Bots are not new. People are aware of them. If they realize you are using bots, you’ll soon witness declining engagement on your account.

> You’ll get banned

If the social media platform detects bots on your account, most probably, your account will be banned. You will lose all your followers.

What’s next for these BOTs?

> Bypassing the CAPTCHA

As I said, bots are not new. In the ongoing war, many websites have implemented CAPTCHA to authenticate users and block bots. We will soon see machine learning models: Convolutional Neural Network (CNN) or Recurrent Neural Network (RNN) getting employed to bypass even complex CAPTCHAs, including math puzzles and text in the image.

> Detecting emotions

A bot comments like a machine. Duh! It will go to a post and comment by selecting a statement from a predefined set. It can put you in a tricky situation by commenting “That’s great” on a sad post. Soon, bots will evolve to recognize human sentiment accurately and craft a response for the comment.

> Creating your content

While bots get your followers, you create your content. That’s what helps you stand out. Soon, bots will be configured to take inputs from you, like a photograph, and use your history of posts to create a new and unique post, as per your taste.

References

[1] https://www.bigcommerce.com/blog/influencer-marketing-statistics/#10-most-important-influencer-marketing-statistics-for-2020

[2] https://www.emarketer.com/content/is-everyone-on-instagram-an-influencer

Hope you found the article insightful. Thank you for reading.

--

--

Kumar Vidit
Geek Culture

I am passionate about solving complex problems by combining technology and business requirements, creating impact in the process.