-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtindergarten.py
More file actions
52 lines (48 loc) · 1.51 KB
/
tindergarten.py
File metadata and controls
52 lines (48 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# file: tindergarten.py
#
# purpose: a simple tinder swipe bot with face detection
#
# usage: start this, then start tinder in your browser, adjust window size
# set all preferences in tinder like age, sex, location
# as soon as the dismiss buttion appears, picture is analyzed with OpenCV
# if a face is detected, this profile will be liked
# drinks, cars, sunsets, flowers and similar are dismissed
#
# hint: maybe the samples for the buttons need to be replaced by your own!
#
import cv2
import time
import pyautogui
import tempfile
#
# main
#
imagePath=tempfile.gettempdir()+r"\my_screenshot.png"
print("Tempfile:",imagePath)
while True:
print ("Waiting for buttons....")
while True:
pos = pyautogui.locateCenterOnScreen('but_dismiss.png')
if pos!=None:
break
time.sleep(5)
print ("Face detection...")
im1 = pyautogui.screenshot(imagePath)
cascPath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascPath)
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(
gray,
scaleFactor=1.1,
minNeighbors=5,
minSize=(100, 100)
)
anzahl=len(faces)
print("Found",anzahl,"faces!")
if anzahl>0:
pos=pyautogui.locateCenterOnScreen('but_like.png')
pyautogui.moveTo(pos[0],pos[1],3.0)
pyautogui.click(pos)
pyautogui.moveRel(100,100,2.0)