Skip to main content

A web crawler for x.com

Project description

autofollow

autofollow is a Python package for automating interactions on social media platforms like Twitter (X) and GitHub.

Installation

You can install autofollow using pip:

pip install autofollow

Usage

Here’s an example of how to use autofollow to automate actions on Twitter (X) and GitHub:

from autofollow.agent import autofollowAgent

def main():
    driver_path = "YOUR_DRIVER_PATH"
    profile_path = "YOUR_PROFILE_PATH"
    twitter_username = "YOUR_TWITTER_USERNAME"
    twitter_password = "YOUR_TWITTER_PASSWORD"
    github_username = "YOUR_GITHUB_USERNAME"
    github_password = "YOUR_GITHUB_PASSWORD"
    url = "https://github.com/orgs/Azure/people"

    agent = autofollowAgent(
        driver_path=driver_path,
        profile_path=profile_path,
        twitter_username=twitter_username,
        twitter_password=twitter_password,
        github_username=github_username,
        github_password=github_password
    )

    try:
        agent.like_tweets(duration=300)
        agent.follow_twitter_users(["https://x.com/jacob_somer_"], duration=300)
        agent.follow_github_users(url, page_number=0, duration=300)
    finally:
        agent.close()

if __name__ == "__main__":
    main()

autofollowAgent Methods

__init__(self, driver_path, profile_path, github_username=None, github_password=None)

Initializes the autofollowAgent.

  • driver_path: Path to the ChromeDriver executable. Download ChromeDriver from here.
  • profile_path: Path to the user profile directory for Chrome. To find this, type "chrome://version" into your Chrome browser's address bar, and look for the "Profile Path" variable.
  • github_username (optional): GitHub username for authentication.
  • github_password (optional): GitHub password for authentication.

like_tweets(duration=300)

Likes tweets on the user's feed for the specified duration.

follow_twitter_users(users, duration=300)

Follows the specified Twitter (X) users for the specified duration.

follow_github_users(url, page_number=0, duration=300)

Follows users on GitHub starting from the specified page number for the specified duration.

Running Tests

To run the tests for this package, use the unittest framework:

python -m unittest discover tests

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

x_web_crawler-0.1.1.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

x_web_crawler-0.1.1-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page