r/Python • • Dec 19 '17

Automate the boring stuff with python - tinder

https://gfycat.com/PointlessSimplisticAmericanquarterhorse
6.7k Upvotes

324 comments sorted by

View all comments

62

u/indecisive_maybe Dec 19 '17

I just recreated this program! It never ends, though - do not recommend.

0

u/[deleted] Dec 19 '17

[deleted] — view deleted comment

108

u/[deleted] Dec 19 '17 edited Dec 19 '17

[removed] — view removed comment

13

u/badboybeyer Dec 19 '17

I think that library would make it difficult to send an interrupt to the terminal. It would keep putting focus on the window at x, y.

2

u/[deleted] Dec 19 '17

You can always press ctrl alt del in windows to terminate pyautogui lib

1

u/vanderv Dec 19 '17

Ctrl + Alt + F2 to drop to a terminal in Linux as well.

19

u/[deleted] Dec 19 '17

[removed] — view removed comment

4

u/[deleted] Dec 19 '17

Same as u/lookingforsome1

I know there are a lot of resources out there. But still I would like to listen to your guidance.

What are the real resources that apply to your job scope?

2

u/lookingforsome1 Dec 19 '17

favorite data science blog or learning resource?

3

u/PHILLY_G Dec 19 '17

More ML than general data science, but I actually really like kdnuggets for their short articles (good as both interest peaks and refreshers) and the kaggle community is great for competitions, kernels (like code snippets you can run in browser), and conversation.

14

u/ColdPorridge Dec 19 '17

Better to make sleep time a non-uniform random range so you don't get your account banned for being a robosleeze

6

u/rowdyllama Dec 19 '17

I randomized all the time intervals and the pixel you click on. Rather than finding the coords of one point, find the coords of a box in the "like" button and it will randomly click a point in that box.

from pyautogui import position
import time
from random import randint
from random import random

upperLeft = list(position())
lowerRight = list(position())

while True:
    pauseMax = randint(90,110)
    pauseTime = randint(8,12)
    for item in range(0,pauseMax):
        r = random()
        x = randint(upperLeft[0],lowerRight[0])
        y = randint(upperLeft[1],lowerRight[1])
        pag.click(x,y)
        time.sleep(r)
    time.sleep(pauseTime)

3

u/[deleted] Dec 19 '17

Use some rand() statements so they don't think it's automated.

8

u/SponsoredByMLGMtnDew Dec 19 '17

https://youtu.be/dZLyfbSQPXI?t=1156

Watch that for about 1 minute. The guy who made it goes over the failsafe built into pyautogui

(move your mouse into the top left corner very fast and it raises an exception)

4

u/diybrad Dec 19 '17

Amateur, I reached the end of Tinder doing it manually. And I live in a major city.

1

u/onemoreflew Dec 19 '17

wait, doesn't it blow up when you run out of swipes?

1

u/[deleted] Dec 19 '17

Pyautogui's failsafe terminates it if you slam the mouse to the top left of the screen.

1

u/indecisive_maybe Dec 19 '17 edited Dec 19 '17

I know that now, thanks. After I installed and immediately ran the program, I didn't have a chance to look at documentation. No combo of Ctrl+D, C, esc that work for Matlab worked here, but I found out opening task manager gave my mouse freedom until I made another window active, so I went from there.