Metadata-Version: 2.1
Name: twitterer
Version: 0.0.1
Summary: Python's package to scrape Twitter with selenium.
License: MIT License
        
        Copyright (c) 2024 CatBraaain
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/CatBraaain/twitterer
Keywords: twitter,selenium,scrape,scraping,scraper,twitterer,bot
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bs4
Requires-Dist: fake-useragent
Requires-Dist: jsonpickle
Requires-Dist: lxml
Requires-Dist: python-dotenv
Requires-Dist: selenium >=4.6

﻿# twitterer

Python's package to scrape Twitter with selenium.
Get, like, retweet tweets with automatically.

## Usage
1. Install python package
```cmd
pip install twitterer
```
2. Create `.env` file at project root.
```properties
TWITTER_USERNAME = ReplaceThisToYourOwns
TWITTER_PASSWORD = ReplaceThisToYourOwns
```

### Get tweets and save it
```python
from twitterer import Twitterer

twitterer = Twitterer()
twitterer.authenticate()
tweets = list(
    twitterer.get_tweets(
        url="https://twitter.com/search?q=funny%20filter:videos",
        max_tweets=20,
    )
)

twitterer.save_to_file(tweets)
```

### Like and retweet tweets
`.get_tweets()` method returns generator.
This is real-time processing, so when you use `.like()` or `.retweet()` method on tweets, i must be handled by a generator.
```python
from twitterer import Twitterer

twitterer = Twitterer()
twitterer.authenticate()
for tweet in twitterer.get_tweets(
    url="https://twitter.com/home",
    max_tweets=20,
):
    tweet.like()
    tweet.retweet()
```

