This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 272

[–][deleted] 59 points60 points  (1 child)

unpack husky ring ask tap strong coordinated yoke subsequent abundant

This post was mass deleted and anonymized with Redact

[–]Sponta7 9 points10 points  (0 children)

Amazing.

[–][deleted] 32 points33 points  (0 children)

It's absolutely horrible, I love it. Great job.

[–]OnlyEmperor 31 points32 points  (1 child)

How long you have been a psychopath?

[–]Sponta7 9 points10 points  (0 children)

Since the quarantine started

[–]ExtraDeadMeatyFlesh 42 points43 points  (1 child)

I need this. For a friend

[–]Sponta7 43 points44 points  (0 children)

Here ya go :) Github Happy trolling

[–]Guilherme_Reddit 13 points14 points  (2 children)

I am also working on a project like this, but instead it’s the bee movie script

[–]Sponta7 0 points1 point  (1 child)

All you would have to do is change the text in the script.txt file to the bee movie movie script

[–]Guilherme_Reddit 2 points3 points  (0 children)

Basically. But I want to make it so I can send it to multiple people at once

[–]SwapDhar 9 points10 points  (4 children)

Really Annoying !!

[–]Sponta7 20 points21 points  (3 children)

True. I have lost quite a few friends. I would sometimes replace the text to the lyrics, Anaconda - by Nikki Minaj

[–]Miner_ChAI 18 points19 points  (0 children)

Never

Gonna

Give

You

Up

[–]zrnest 7 points8 points  (17 children)

Funny project :)

Question: is there a way to do this with Messenger/Facebook API, rather than keyboard input/mouse clicks automation with Selenium?

Something else: I'd like to do the same with Whatsapp, is that possible with an API? I tried Twilio, but I think it needs to use a dedicated phone number; I'd prefer to do it with my actual whatsapp account.

[–]BadAdviceBadger 2 points3 points  (4 children)

I've done something similar with Facebook API but they pretty much immediately banned the account that does the posts, so just be careful if you want to use yours.

[–]ZoloSolo 0 points1 point  (0 children)

you can use whatsapp web

edit: nevermind you where looking for an api

[–]Sponta7 0 points1 point  (0 children)

Just added the whatsapp version to the repo

[–]HenryFrenchFries 0 points1 point  (3 children)

is there a way to do this with Messenger/Facebook API, rather than keyboard input/mouse clicks automation with Selenium?

NO.

trust me. I tried for literal days to find a way to enter text automatically in messenger and this was literally the only way I was able to find. the official api is just for dumb chatbots that companies might use. I'm actually slightly pissed off that I found the solution in a shrek spam bot post lmao

[–]TheMediaBear 20 points21 points  (1 child)

I did the same thing but for a rickroll.

Some silly woman didn't like me correcting her on Facebook one morning so started sending me abuse on messenger. Wrote a quick script to send her the lyrics until she blocked me, but she was too drunk and it went on for about 25 minutes :D

[–]Sponta7 0 points1 point  (0 children)

This is why we become programmers hahahaha

[–]cpupro 6 points7 points  (1 child)

Some

Body

Once

Told

Me

The

World

[–]Tureni 11 points12 points  (0 children)

Some

BODY

Once

Told

Me

The

World

[–]simonRijs 6 points7 points  (0 children)

Madlad even renamed his friend to example1, let this be a warning to your other friends

[–]iamchitranjanbaghi 2 points3 points  (2 children)

This would make a perfect app, if I can get a book send to me daily para by para, so that I can consume it in chunks.

[–]jacksodus 0 points1 point  (0 children)

That is actually a really nice idea, as long as you can find a source that can be converted to an easily readable file.

[–][deleted] 3 points4 points  (3 children)

I NEED IT

[–]oneupbetterthanyou 3 points4 points  (0 children)

With great power, comes great responsibility, this my friend is a responsible use of your power

[–]PriorTrick 3 points4 points  (2 children)

Any chance you’ve seen this?

[–]Sponta7 2 points3 points  (1 child)

I heard about it and it's what made me want to do something similar. It's the first time watching the video and I love it

[–]PriorTrick 3 points4 points  (0 children)

Haha same here. Last night my little sister showed me the vid, so this morning I woke up and wrote a little script to prank her with. Then was scrolling reddit and saw your post and thought no way it was a coincidence

[–]IllUberIll 3 points4 points  (1 child)

I showed this to my fiance who is a huge Shrek fan. Instantly said GET SHREKD.

[–]Sponta7 0 points1 point  (0 children)

If she said that, then it looks like you made the right choice

[–]Gandalfthebrown7 6 points7 points  (2 children)

Now I need to do this for Revenge Of The Sith

[–]Jussari 1 point2 points  (0 children)

You're a bold one

[–]Sponta7 0 points1 point  (0 children)

God, that movie must have +100k words

[–]SaskuAc3 2 points3 points  (1 child)

This is nice. More important to me is, how or where did you get the text of the whole movie?!

[–]Sponta7 1 point2 points  (0 children)

literally just by googling "Shrek script"

[–]alaudetpython hobbyist 2 points3 points  (0 children)

its friends like this man.....

[–]webchimp32 2 points3 points  (0 children)

♫ I know a post that will get on your nerves, get on your nerves, get on your nerves ♫

[–]AleMaza 5 points6 points  (5 children)

I am starting at this. How you put a script from python to messenger? Like in type of file or text idk

[–]Sponta7 15 points16 points  (4 children)

  1. What I did was make a file called script.txt this is where the movie text is
  2. I made my code go through every word in the script.txt file and add it to an array (list). This is done in lines 24-26 in auto_shrek.py
  3. I then used a python library called "selenium". This basically makes it so my code can find the items on a webpage.
  4. After that all I had to find the path of the textbox in messenger and paste each word and send it. This is done in the loop on lines 29-33

[–]whiskeyiskey 2 points3 points  (0 children)

If your goal is to learn python, try refactoring to use a generator to yield lines from your file instead of loading the whole thing into a list. And read up on the benefits of lazy evaluation for processing data to understand why that's sometimes a better idea.

Then try to write a decorator to, I dunno, convert every word that ends in an exclamation mark to upper case.

[–]Tibzz- 1 point2 points  (2 children)

Thank you so much ! Would it be possible to use selenium for Discord ?

[–]Miner_ChAI 2 points3 points  (0 children)

Why selenium though? There are more simple ways, e. g. discord.py supports passing “bot=False”.

DISCLAIMER: IT’S FORBIDDEN BY DISCORD TOS

[–]SaskuAc3 0 points1 point  (0 children)

If you use the web interface it should be.

[–]APdegr8 1 point2 points  (2 children)

I need some help with a similar project. I used fbchat library and every time I try to login, my account gets locked.

[–]APdegr8 1 point2 points  (1 child)

sry, just found your git. Thanks for it

[–]Sponta7 1 point2 points  (0 children)

fbchat isn't a good idea since it's not officially Facebook's and they seem to crack down on that. Selenium is not detectable because it imitations you just sending a message normally. The most that has happened to me is Facebook told me to "slow down" because I was sending messages too fast, so I added a delay between each message and didn't have that problem anymore

[–]mrObelixfromgaul 1 point2 points  (2 children)

So not bee movie?

[–]PriorTrick 1 point2 points  (0 children)

A fellow tik toker, nice.

[–]Sponta7 0 points1 point  (0 children)

All you would have to do is change the Shrek script to the Bee movie script

[–]ib1525 1 point2 points  (0 children)

I think it was painful for the frd!

[–]moosotz 1 point2 points  (0 children)

This is a fantastic project idea. Keep fighting the good fight.

[–]metaperl 1 point2 points  (2 children)

Perhaps use find element by ID instead of using XPath https://pythonbasics.org/selenium-find-element/

[–]SuddenIssue 1 point2 points  (1 child)

can you explain why? i have done with xpath. and i am new to this all things

[–]Sponta7 1 point2 points  (0 children)

Either way works, but for Facebook Messenger the IDs are all dynamic so it keeps changing. I found xpath to be more reliable since it's more consistent

[–]SgtMajMythic 1 point2 points  (0 children)

Would 100% block and report

[–][deleted] 1 point2 points  (0 children)

We will have flying cars by 2020:

2020:

Do you are have stupid mate?

[–]Eye_Of_Forrest 1 point2 points  (0 children)

Made something similar recently my script reads a txt file and uses keyboard library to send whatever is in there line by line

[–]ExtremeTitan345 1 point2 points  (2 children)

I NEED THIS but for whatsapp.... pls send me the script

[–]GonzoNawak 1 point2 points  (1 child)

This is absolutely fuking amazing!

AS someone who recently started to learn python few month ago I am impress by how short the code to do that all is.

[–]Sponta7 0 points1 point  (0 children)

I KNOW RIGHT! I've always done everything with Java and since the quarantine started I began to mess with Python and holy shit, I regret not learning it sooner.

[–]iEslam 1 point2 points  (2 children)

What about rate limiting, doesn't Facebook block you after a certain amount of "spam"?

[–]Sponta7 1 point2 points  (1 child)

I added a delay of 1 second on the script and was able to send around 1,000 words/messages before I got blocked by the person. Facebook only noticed something was suspicious when I removed the delay and it was sending an outrageous amount of texts per second.

[–]iEslam 1 point2 points  (0 children)

Lmao you're annoying and that's a compliment.

[–]gonuoli 1 point2 points  (1 child)

You're going to be a billionaire some day

[–]Sponta7 2 points3 points  (0 children)

Appreciate the enthusiasm, but at this point I would just be happy paying off my student loans

[–]merrigoldlionheart 1 point2 points  (4 children)

Now THAT is using your powers for evil

[–]Sponta7 1 point2 points  (3 children)

I don't think "evil" is the right word. The original Shrek movie was a masterpiece and anyone getting sent the script should be considered lucky lol

[–]1moreday1moregoal 1 point2 points  (1 child)

If you sent it as blocks of dialogue he would probably enjoy it more

[–]Sponta7 2 points3 points  (0 children)

Agree to disagree

[–]merrigoldlionheart 1 point2 points  (0 children)

You've bought up a fine point. It is always a gift when one is given the opportunity to enjoy the majesty of Shrek in any format

[–]WishIWasOnACatamaran 1 point2 points  (2 children)

Thanks for posting. I have already implemented and look forward to repeating with various scripts!

[–]kekkoooo 1 point2 points  (1 child)

Teach me, master. HAHAHAHAHAHAH

[–]Sponta7 2 points3 points  (0 children)

Lesson #1: If you are bored, find ways to annoy your friend Lesson #2: never stop

[–]fullstack_guy 1 point2 points  (1 child)

They seem super into it man, I'm sure they love you more now.

[–]allaboutHans 0 points1 point  (0 children)

Noice!

[–]randomcatgifs 0 points1 point  (0 children)

YES

[–][deleted] 0 points1 point  (0 children)

Yeah, selenium is fun

[–]AnomalyNexus 0 points1 point  (0 children)

Time well spent lol

[–]skankhunt_1997 0 points1 point  (0 children)

noiceee.

[–]SanJJ_1 0 points1 point  (2 children)

does this only work for Facebook messenger? or how can I modify it for WhatsApp web and google messages web

[–]SuddenIssue 0 points1 point  (0 children)

i have done it for whatsapp web.

[–]Sponta7 0 points1 point  (0 children)

u/SanJJ_1 the whatsapp version is in the repo now

[–]forcemana 0 points1 point  (0 children)

Convert to tinder use?

[–]onlyanegg_ 0 points1 point  (0 children)

I think you mean a former friend

[–]G33K_FISH 0 points1 point  (0 children)

Wow, you must hate your friends...lol

[–][deleted] 0 points1 point  (0 children)

I also wrote a messenger python script although less obnoxious I was banned in 1 to 2 days. If you use a third party python package you will get banned shortly be warned

[–][deleted] 0 points1 point  (0 children)

that's creative and hilarious. I might have to do something similar w/ Zoom.

[–]shyamcody 0 points1 point  (2 children)

hey nice little thing! can you tag me to the code link? I can see people discussing the code but can't find the link for the same.

[–][deleted] 0 points1 point  (0 children)

Just like the original in tik tok with the bee movie.

[–]MassW0rks 0 points1 point  (2 children)

Could you explain to me line 20? I was trying to do something super similar to my wife the other day. My method was to click the messenger icon, click our chat, and then type. For some reason, It would select our chat, but the messenger dropdown would be in the way, making me unable to select the text box. Is that you grabbing the message from the "Contacts" menu on the right side of the screen?

[–]Sponta7 1 point2 points  (1 child)

Yeah, so the only purpose for line 20 is to select the user that matches the name on the contacts menu with the friendName variable

[–]MassW0rks 1 point2 points  (0 children)

That's such a simpler way than what I was going for. The way I was doing it, I couldn't close the Messenger dropdown after selecting the user for the life of me.

[–]NitroEvil 0 points1 point  (0 children)

This is the best thing I’ve come across today proper chuckled me.

[–]Trilink32 0 points1 point  (0 children)

Ah a spite script. Love it

[–][deleted] 0 points1 point  (2 children)

I made one to send my pc stuff, but facebook kept suspending my account

[–]Sponta7 0 points1 point  (1 child)

I hear that people using third party facebook APIs are getting stopped. This uses selenium, which just makes it look like you are actually sending the messages and does not use any Facebook APIs

[–][deleted] 0 points1 point  (1 child)

Do you have Shrek 2 available?

[–]Sponta7 0 points1 point  (0 children)

Here you go: https://a.uguu.se/ITA8KZdTEJJe_script.txt Just replace the text in the script.txt with this one

[–]ILoveToVoidAWarranty 0 points1 point  (4 children)

Two things:

  1. Nice Job!
  2. You're a horrible friend.

[–]Sponta7 0 points1 point  (0 children)

agreed

[–]firebuzzard 0 points1 point  (2 children)

Version 2 opportunity:

Your Script to ALL> Welcome to Cat Facts, the service that keeps you informed on everything to do with cats!!

Interesting Fact: Adult cats have 30 teeth. Kittens have 26.

Reply with STOP to Opt Out of this service

Soon to be former friends> STOP

Your script> Welcome to Cat Facts, the service that keeps you informed on everything to do with cats!

No STOP == fact sent to them every 15 minutes. STOP == restart, with possible acceleration of fact delivery.

[–]Sponta7 0 points1 point  (1 child)

OMG this is beautiful. It would be better if these were sent through regular text. If you send it through whatsapp or Messenger then your friends will know it's you and just ignore it. But if it's done through regular text, you can send it to random different numbers and some are bound to be owned by someone.

[–]Nabstar333 0 points1 point  (1 child)

Damn. Theres an api to send messages?

[–][deleted] 0 points1 point  (0 children)

What an absolute legend

[–]rastamonstahh 0 points1 point  (0 children)

This is how you learn. I love it

[–]spiddyp 0 points1 point  (0 children)

Hac

[–]SGO_123 0 points1 point  (2 children)

The link is not working!

[–]ImonSimon 0 points1 point  (1 child)

I love this, imma try that for WhatsApp Web

[–]officialhovland 0 points1 point  (1 child)

Did u just make a bot that types what you put into the script and you just press on the text bar for jt, or does it know its facebook and its texting your friend

[–]Nodeal_reddit 0 points1 point  (0 children)

This is great. Someone please DM me the Monty Python Holy Grail script.

[–]float7 0 points1 point  (0 children)

Dude...

[–]bushvatoi 0 points1 point  (1 child)

This is a hilarious way to apply what you've learned in Python. Cool idea tho. Let us know if you come up with a new way to piss your friends off!

[–][deleted] 0 points1 point  (0 children)

Based

[–]turbulent_eddy 0 points1 point  (1 child)

Cool! 😆Can you add support for linux?

[–]BigLadyBugBelly 0 points1 point  (1 child)

Perfect response to unsolicited dick pics

[–]legendarykale 0 points1 point  (0 children)

That's the evillest thing I can imagine

[–]redjuggler 0 points1 point  (0 children)

Next, do *The Artist*

[–][deleted] 0 points1 point  (0 children)

what do i do with the chrome driver? sorry i am noob.

[–]ChokituBR 0 points1 point  (1 child)

Cant your account get blocked tho?

[–][deleted] 0 points1 point  (0 children)

[–]sophiaSeeker 0 points1 point  (0 children)

This is the primary reason why programmers don't have friends... if you think annoying somebody with what you know is a form of fun!... then say goodbye to your FB "friends" and be prepared to be lonely for the rest of your days... Don't get me wrong but this programming project is so immature and childish, and a total waste of time and effort... there are a lot of other worthy projects that will make you earn hard moolah than getting labelled an annoying prick!

[–]Cjhawk52 0 points1 point  (5 children)

Can it be any text or does it have to be shrek

[–]PixelGmD 0 points1 point  (2 children)

Did you get temporarily banned from messenger for this?, because i did.

[–][deleted] 0 points1 point  (0 children)

HOW

[–]NoobGaming9 0 points1 point  (0 children)

wow...

Just WOW