An Instagram bot that can mass text users, receive and read a text, and store it somewhere with user details.

Overview

Instagram Bot 🤖

July 14, 2021

Overview 👍

A multifunctionality automated instagram bot that can mass text users, receive and read a message and store it somewhere with user details and much more. Powered by Selenium.

forthebadge made-with-python

Get Started 🤞

  • PIPENV: For virtual environment
  • $ pip install pipenv


  • Installing required libraries and versions
  • $ pipenv install


  • Starting the PIP virtual environment
  • $ pipenv shell


    Launching Instagrambot Web App 🎮


     Web App

    Inside the virtual environment, type:

    $ flask run

    and open the URL.


    Multipurpose Bot 🛰️ 🛰

    • Login-out using credentials
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.logout()
    

    • Direct Message anyone
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.dm('user','Hi there')
    bot.logout()
    

    • Follow another user
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.follow_users(['user1','user2'])
    bot.logout()
    

    • Like a number of posts by a user/hashtag
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.like_by_keyword(keyword, numOfPosts)
    bot.logout()
    

    • Create a group and direct message in it
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.group_dm(['user1','user2', 'user3'],'Final Testing')
    bot.logout()
    

    • Direct Message multiple users
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.multiple_dm(['user1','user2', 'user3'],'Final Testing')
    bot.logout()
    

    • Direct Message multiple users from a csv file
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    # if csv file doesn't contains message column
    bot.multiple_dm_from_csv('path to csv file','general message')
    # else
    bot.multiple_dm_from_csv('path to csv file') 
    bot.logout()
    

    • Direct Message multiple users from a db
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.multiple_dm_from_db(general_message)
    bot.logout()
    

    • Direct Message to all Followers
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.multiple_dm_followers(general_message)
    bot.logout()
    

    • Retrieve the latest message from multiple user

        UPDATE THE IMAGES DIRECTORY WITH SCREENSHOTS TAKEN FROM YOUR COMPUTER

        UPDATE THE DATABASE CREDENTIALS IN db_credentials.py FILE

    For further reference watch this video: https://www.youtube.com/watch?v=XI_GyOnw3M0

    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.retrieve_messages([users])
    bot.logout()
    

    • Retrieve the latest message from multiple user in a csv file

        UPDATE THE IMAGES DIRECTORY WITH SCREENSHOTS TAKEN FROM YOUR COMPUTER

        UPDATE THE DATABASE CREDENTIALS IN db_credentials.py FILE

    For further reference watch this video: https://www.youtube.com/watch?v=XI_GyOnw3M0

    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.retrieve_messages_from_csv('path to csv file')
    bot.logout()
    

    • Retrieve the latest message from users from our inbox

        UPDATE THE IMAGES DIRECTORY WITH SCREENSHOTS TAKEN FROM YOUR COMPUTER

        UPDATE THE DATABASE CREDENTIALS IN db_credentials.py FILE

    For further reference watch this video: https://www.youtube.com/watch?v=XI_GyOnw3M0

    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.retrieve_messages_from_inbox(tolerance = 2)
    bot.logout()
    

    • Download posts by a keyword
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.download_pics(keyword)
    bot.logout()
    

    • Share latest post according to preferred category (as in replied message):
    from BOT import Bot
    bot = Bot()
    bot.login(username, password)
    bot.share_latest_post()
    bot.logout()
    

    Individual Functionalities:

    • Login into Instagram: (Achieved)
      from __login__ import Login
      
      Login(driver, <username>, <password>)
      

    • Texting to a Single User: (Achieved)
      from __dm__ import 
      
      Dm(driver, <user>, <message>)
      

    • Following Users: (Achieved)
      from __follow_users__ import Follow_users
      
      Follow_users(driver, ['user1','user2'])
      

    • Retrieving messages from single/multiple user(s): (Achieved)

          UPDATE THE IMAGES DIRECTORY WITH SCREENSHOTS TAKEN FROM YOUR COMPUTER

          UPDATE THE DATABASE CREDENTIALS IN db_credentials.py FILE

      For further reference watch this video: https://www.youtube.com/watch?v=XI_GyOnw3M0

      from __retrieve_messages__ import Retrieve_messages
      
      Retrieve_messages(driver, [users])
      

    • Retrieving messages from single/multiple user(s) with names in a csv file: (Achieved)

          UPDATE THE IMAGES DIRECTORY WITH SCREENSHOTS TAKEN FROM YOUR COMPUTER

          UPDATE THE DATABASE CREDENTIALS IN db_credentials.py FILE

      For further reference watch this video: https://www.youtube.com/watch?v=XI_GyOnw3M0

      from __retrieve_messages_from_csv__ import Retrieve_messages_from_csv
      
      Retrieve_messages_from_csv(driver, 'path to csv file')
      

    • Retrieving messages from single/multiple user(s) from inbox: (Achieved)

          UPDATE THE IMAGES DIRECTORY WITH SCREENSHOTS TAKEN FROM YOUR COMPUTER

          UPDATE THE DATABASE CREDENTIALS IN db_credentials.py FILE

      For further reference watch this video: https://www.youtube.com/watch?v=XI_GyOnw3M0

      from __retrieve_messages_from_inbox__ import Retrieve_messages_from_inbox
      
      Retrieve_messages_from_inbox(tolerance = 1)
      

    • Texting to Multiple Users: (Achieved)
      from __multiple_dm__ import Multiple_dm
      
      Multiple_dm(driver, [users], <message>)
      

    • Texting to Multiple Users from a csv file: (Achieved)
      from __multiple_dm_from_csv__ import Multiple_dm_from_csv
      
      Multiple_dm_from_csv(driver, 'path to csv file', <general message (optional)>)
      

    • Texting to Multiple Users from a Database: (Achieved)
      from __multiple_dm_from_db__ import Multiple_dm_from_db
      
      Multiple_dm_from_db(driver, <general message (optional)>)
      

    • Texting to all Followers: (Achieved)
      from __multiple_dm_followers__ import Multiple_dm_followers
      
      Multiple_dm_followers(driver, <general message (optional)>)
      

    • Creating Group and texting in it: (Achieved)
      from __group_dm__ import Group_dm 
      
      Group_dm(driver, [users], <message>)
      

    • Downloading a number of posts with a keyword: (Achieved)
      from __download_pics__ import Download_pics
      
      Download_pics(driver, <keyword>)
      

    • Liking a number of posts of a user/hashtag: (Achieved)
      from __like_by_keyword__ import Like_by_keyword
      
      Like_by_keyword(driver, <keyword>)
      

    • Logging Out: (Achieved)
      from __logout__ import Logout
      
      Logout(driver)
      

    • GUI app: (On the way)

    Platform: Python files. Virtual Environment using PIPENV.

    Libraries: Selenium, Instabot, InstaPy, Time, Pyperclip, Pyautogui, OpenCv, os, wget, pymongo

    Softwares: Windows Chromedriver, MongoDB

    Low-Level Specs: Whole program is built in Object Oriented fashion and Modular structure is followed throughout.

    Owner
    Abhilash Datta
    I'm a 3rd year undergraduate from @IITKGP interested in Software Development and AI. I believe in forever learning can do anything for the betterment of society
    Abhilash Datta
    Cloint India Pvt. Ltd's (ClointFusion) Pythonic RPA (Automation) Platform

    Welcome to , Made in India with ❤️ Description Cloint India Pvt. Ltd - Python functions for Robotic Process Automation shortly RPA. What is ClointFusi

    Cloint India Pvt. Ltd 31 Apr 12, 2022
    The Penetration Testers Framework (PTF) is a way for modular support for up-to-date tools.

    The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu/ArchLinux based distributions to create a similar and familiar distribution for Penetration Testing

    trustedsec 4.5k Dec 28, 2022
    Just a small test with lists in cython

    Test for lists in cython Algorithm create a list of 10^4 lists each with 10^4 floats values (namely: 0.1) - 2 nested for iterate each list and compute

    Federico Simonetta 32 Jul 23, 2022
    A browser automation framework and ecosystem.

    Selenium Selenium is an umbrella project encapsulating a variety of tools and libraries enabling web browser automation. Selenium specifically provide

    Selenium 25.5k Jan 01, 2023
    Cornell record & replay mock server

    Cornell: record & replay mock server Cornell makes it dead simple, via its record and replay features to perform end-to-end testing in a fast and isol

    HiredScoreLabs 134 Sep 15, 2022
    Tutorial for integrating Oxylabs' Residential Proxies with Selenium

    Oxylabs’ Residential Proxies integration with Selenium Requirements For the integration to work, you'll need to install Selenium on your system. You c

    Oxylabs.io 8 Dec 08, 2022
    The evaluator covering all of the metrics required by tasks within the DUE Benchmark.

    DUE Evaluator The repository contains the evaluator covering all of the metrics required by tasks within the DUE Benchmark, i.e., set-based F1 (for KI

    DUE Benchmark 4 Jan 21, 2022
    A single module to link Python ecosystem to the Web

    A single module to link Python ecosystem to the Web. Have a quick look at the Gallery first to get convinced ! FAQ For any questions, please use Stack

    66 Dec 21, 2022
    Python scripts for a generic performance testing infrastructure using Locust.

    TODOs Reference to published paper or online version of it loadtest_plotter.py: Cleanup and reading data from files ARS_simulation.py: Cleanup, docume

    Juri Tomak 3 Dec 15, 2022
    Generic automation framework for acceptance testing and RPA

    Robot Framework Introduction Installation Example Usage Documentation Support and contact Contributing License Introduction Robot Framework is a gener

    Robot Framework 7.7k Jan 07, 2023
    A folder automation made using Watch-dog, it only works in linux for now but I assume, it will be adaptable to mac and PC as well

    folder-automation A folder automation made using Watch-dog, it only works in linux for now but I assume, it will be adaptable to mac and PC as well Th

    Parag Jyoti Paul 31 May 28, 2021
    ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries.

    ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries. With this f

    Mustafa 1 Jul 11, 2022
    Pytest-typechecker - Pytest plugin to test how type checkers respond to code

    pytest-typechecker this is a plugin for pytest that allows you to create tests t

    vivax 2 Aug 20, 2022
    A pytest plugin to run an ansible collection's unit tests with pytest.

    pytest-ansible-units An experimental pytest plugin to run an ansible collection's unit tests with pytest. Description pytest-ansible-units is a pytest

    Community managed Ansible repositories 9 Dec 09, 2022
    Baseball Discord bot that can post up-to-date scores, lineups, and home runs.

    Sunny Day Discord Bot Baseball Discord bot that can post up-to-date scores, lineups, and home runs. Uses webscraping techniques to scrape baseball dat

    Benjamin Hammack 1 Jun 20, 2022
    Python Projects - Few Python projects with Testing using Pytest

    Python_Projects Few Python projects : Fast_API_Docker_PyTest- Just a simple auto

    Tal Mogendorff 1 Jan 22, 2022
    A simple script to login into twitter using Selenium in python.

    Quick Talk A simple script to login into twitter using Selenium in python. I was looking for a way to login into twitter using Selenium in python. Sin

    Lzy-slh 4 Nov 20, 2022
    Ward is a modern test framework for Python with a focus on productivity and readability.

    Ward is a modern test framework for Python with a focus on productivity and readability.

    Darren Burns 1k Dec 31, 2022
    UX Analytics & A/B Testing

    UX Analytics & A/B Testing

    Marvin EDORH 1 Sep 07, 2021
    A pytest plugin, that enables you to test your code that relies on a running PostgreSQL Database

    This is a pytest plugin, that enables you to test your code that relies on a running PostgreSQL Database. It allows you to specify fixtures for PostgreSQL process and client.

    Clearcode 252 Dec 21, 2022