Giter Site home page Giter Site logo

maron09 / instagram-follower-monitor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

Get notified when an account gets a new follower

Python 34.47% CSS 27.43% JavaScript 14.99% HTML 23.12%
flask flask-application follower-tracker instagram telegarm-bot telegram

instagram-follower-monitor's Introduction

Follower Monitoring Telegram Bot

This project is a Flask-based web application designed to monitor the follower counts of specified usernames on a social media platform. It sends notifications to a Telegram chat whenever there is an increase in followers.

Features

  • Set Usernames: Specify a list of usernames to monitor.
  • Start/Stop Monitoring: Start or stop the monitoring process.
  • Follower Count Checking: Periodically checks follower counts and detects new followers.
  • Telegram Notifications: Sends a message to a specified Telegram chat when new followers are detected.

Technologies Used

  • Flask: Web framework for building the application.
  • APScheduler: For scheduling periodic follower count checks.
  • Telegram Bot API: For sending notifications.
  • Decouple: For managing configuration variables.

Installation

  1. Clone the repository:

    git clone https://github.com/maron09/follower-monitoring-bot.git
    cd follower-monitoring-bot
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Create a .env file in the project root and add your Telegram bot token and chat ID:

    TELEGRAM_BOT_TOKEN=your-telegram-bot-token
    TELEGRAM_CHAT_ID=your-telegram-chat-id
    
  5. Ensure you have the follower module with a get_follower_count function:

    # follower.py
    
    def get_follower_count(username):
        # Implement this function to return the follower count for the given username
        pass

Running the Application

  1. Run the Flask application:

    python app.py
  2. Open your web browser and navigate to:

    http://127.0.0.1:5000/
    

API Endpoints

  • GET /: Renders the index page.
  • POST /set_usernames: Sets the list of usernames to monitor. Expects a JSON payload with a usernames key.
    {
      "usernames": ["username1", "username2"]
    }
  • POST /start_monitoring: Starts the monitoring process.
  • POST /stop_monitoring: Stops the monitoring process.

How It Works

  1. Set Usernames:

    • Use the /set_usernames endpoint to specify the usernames you want to monitor.
    • This initializes the last_follower_counts dictionary with the current follower counts for the provided usernames.
  2. Start Monitoring:

    • Use the /start_monitoring endpoint to start the periodic follower count checks.
    • The check_followers function is scheduled to run every minute.
  3. Check Followers:

    • The check_followers function retrieves the current follower count for each username.
    • If there is an increase in the follower count, a Telegram message is sent to the specified chat.
  4. Stop Monitoring:

    • Use the /stop_monitoring endpoint to stop the monitoring process.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Contact

For any inquiries, please reach out to [[email protected]].


instagram-follower-monitor's People

Contributors

maron09 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.