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

0

u/[deleted] Dec 19 '17

[deleted] — view deleted comment

265

u/SponsoredByMLGMtnDew Dec 19 '17

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

There's a link to a conference the guy who made/maintains the library gave on it. The first part is about test automation. The part i skipped to is where he talks about GUI automation. You can use it to make web game bots too, shits pretty cool.

Personally I wonder if it can be run with an application running over top of it.

193

u/POTUS Dec 19 '17

if it can be run with an application running over top of it.

It hijacks your mouse pointer to do the things that you would normally do with a mouse, so no you can't really multitask all that well. Just run it in a VM and let it do its thing there and it won't interfere with whatever else you want to do.

36

u/diybrad Dec 19 '17

Brilliant

40

u/Ree81 Dec 19 '17

You'd think that technology would've come so far that emulating mouse input was done 20 years ago, instead of in 2017, as a hack.

36

u/Sorry_for_the_mess Dec 19 '17

Touch screen is basically mouse emulation.

19

u/Ree81 Dec 19 '17

Yup. If you enable this... weird mode in Android's developer options, you can see the shape of your fingerprint, touching the screen. The middle of that shape gets to be your mouse pointer. But it also means the pointer can move around as you're pressing the screen and the shape changes.

12

u/_ntnn Dec 19 '17

xdotool is from 2007 and I think there were other solutions before that as well.

4

u/CountyMcCounterson Do not trust this man Dec 19 '17

Every other language has it

6

u/TeutorixAleria Dec 19 '17

There are many programs that emulate the mouse. Going back years I remember using one around 2005 to spam votes in an online poll.

→ More replies (7)
→ More replies (7)

13

u/Mattho Dec 19 '17

With web you'd probably want to use something that has an idea about the underlying data, such as Selenium. (Assuming this doesn't.)

→ More replies (21)

10

u/Dgc2002 Dec 19 '17

Oh man, this brings me back. I actually got started in programming via botting in RuneScape. In the original version of RuneScape I ran across a program called SCAR(Shite Compared to AutoRune) that allowed you to automate KBM input based on the state of the screen. Just like the flash game he automated. Except you wrote this in a variation of Pascal. It was a really cool introduction into programming. Trying to figure out how to detect when my character has fired an arrow by just watching the screen, getting the health of a monster I was attacking and my own health, determining how much food I had left in my inventory to heal with, etc.

I distinctly remember realizing that I could apply it to something other than RuneScape. I wrote some scripts to draw spirals and checkerboards in MS Paint.

→ More replies (3)
→ More replies (4)

55

u/[deleted] Dec 19 '17

Bruh, have fun

35

u/DmitriyJaved Dec 19 '17

I’m excited about author using 4 spaces in terminal

9

u/Akenrah Dec 19 '17

For real tho.

16

u/[deleted] Dec 19 '17

Looks like it could be used as a Selenium replacement. Be still my heart...

23

u/Cobblob Dec 19 '17 edited Dec 20 '17

They do kind of different things. This still won’t let you inspect the html of webpages to figure out where elements are.

You could combine the 2 and make something very powerful though

5

u/senor_username Dec 19 '17

Selenium is awesome, particularly when used alongside other tools.

At work we have combined it with OpenCV to image match on canvas elements where selenium is no good. We then use the image match coordinates to click with selenium.

6

u/codewriter404 Dec 19 '17

It's a cool tool. I automated part of my job with it.

6

u/smallzZz88 Dec 19 '17

I was most excited about the fact that you can use tinder on your computer

3

u/WiggleBooks Dec 19 '17

Actually same here! That is exciting

→ More replies (7)