Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislawfortonski committed Jul 18, 2021
1 parent e2ee78c commit 3ff3e1e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,4 @@ geckodriver.log
geckodriver.exe
geckodriver
instagram.txt
snap.txt
config_.json
snap.txt
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This bot will help you automate giving likes and dislikes. The bot will also lik
1. Install Firefox. Link: https://www.mozilla.org
2. Install Python environment. Link: https://www.python.org
3. Add Python path to your system environment variables.
4. Install Selenium for Python. Link: https://selenium-python.readthedocs.io/installation.html
4. Install Libraries (when you are in unpacked app folder)
```
pip install selenium
pip install -r requirements.txt
```
5. Download driver for your Firefox version. Link: https://github.com/mozilla/geckodriver/releases and put it to source files.
5. Open and edit `config.json`.
Expand Down Expand Up @@ -45,9 +45,9 @@ In your `config.json` file have to change following things:
5. This option `amount_of_login_attempts` sets the number of attempts after which if you don't log in It will error occurs. Default is 15.
6. This option `amount_of_avoid_errors` sets the number of attempts that after program will show error message and exit. Default is 5.
7. If you want to save Instagram nick from description set `allow_to_save_ig` to true. Default is true.
8. Choose path to your file with Instagram nicknames so change `ig_file_path`. Default is "instagram.txt".
8. Choose path to your file with Instagram nicknames so change `ig_file_path`. Default is "logs/instagram.txt".
9. If you want to save Snapchat nick from description set `allow_to_save_snap` to True. Default is true.
10. Choose path to your file with Snapchat nicknames so change `snap_file_path`. Default is "snap.txt".
10. Choose path to your file with Snapchat nicknames so change `snap_file_path`. Default is "logs/snap.txt".

## Usage
Open your terminal/CMD in Tinder-Bot directory and call: `python app.py` or `python3 app.py`. If you want find only Instagram/Snapchat nicknames you will call: `python app-finder.py` or `python3 app-finder.py`
Expand Down
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"max_wait_time_between_action_in_sec": 10,
"min_wait_time_between_action_in_sec": 4,
"allow_to_save_ig": true,
"ig_file_path": "instagram.txt",
"ig_file_path": "logs/instagram.txt",
"allow_to_save_snap": true,
"snap_file_path": "snap.txt"
"snap_file_path": "logs/snap.txt"
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
selenium~=3.141.0
40 changes: 30 additions & 10 deletions tinder/tinderbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,44 @@ def __doOutOfLikesPopup(self):
pass

def like(self):
try:
self.driver.find_element_by_xpath('/html/body/div[1]/div/div[1]/div/main/div[1]/div/div/div[1]/div/div[2]/div[4]/button').click()
self.__totalLikes += 1
except ElementClickInterceptedException:
success = None
likesButtons = ['/html/body/div[1]/div/div[1]/div/main/div[1]/div/div/div[1]/div[1]/div/div[4]/div/div[4]/button', '/html/body/div[1]/div/div[1]/div/main/div[1]/div/div/div[1]/div[1]/div/div[5]/div/div[4]/button']
for button in likesButtons:
try:
self.driver.find_element_by_xpath(button).click()
self.__totalLikes += 1
success = True
break
except (ElementClickInterceptedException, NoSuchElementException):
continue

if not success:
self.solveProblems()
sleep(2)

def dislike(self):
try:
self.driver.find_element_by_xpath('/html/body/div[1]/div/div[1]/div/main/div[1]/div/div/div[1]/div/div[2]/div[2]/button').click()
self.__totalDislikes += 1
except ElementClickInterceptedException:
success = None
dislikesButtons = ['/html/body/div[1]/div/div[1]/div/main/div[1]/div/div/div[1]/div[1]/div/div[4]/div/div[2]/button', '/html/body/div[1]/div/div[1]/div/main/div[1]/div/div/div[1]/div[1]/div/div[5]/div/div[2]/button']
for button in dislikesButtons:
try:
self.driver.find_element_by_xpath(button).click()
self.__totalDislikes += 1
success = True
break
except (ElementClickInterceptedException, NoSuchElementException):
continue

if not success:
self.solveProblems()
sleep(2)

def solveProblems(self):
try:
self.driver.find_element_by_xpath('/html/body/div[2]/div/div/div/div[3]/button[2]').click()
except NoSuchElementException:
pass

try:
self.driver.find_element_by_xpath('/html/body/div[2]/div/div/button[2]').click()
except NoSuchElementException:
pass
Expand All @@ -63,8 +84,7 @@ def solveProblems(self):
self.driver.find_element_by_xpath('/html/body/div[1]/div/div[1]/div/main/div[2]/div/div/div[1]/div/div[4]/button').click()
except NoSuchElementException:
pass



def __str__(self):
total = self.getTotalActions()
return f'=== Tinder results ===\n* Total actions: {total}\n* Total likes: {self.__totalLikes}\n* Total disLikes: {self.__totalDislikes}'
Expand Down

0 comments on commit 3ff3e1e

Please sign in to comment.