Skip to main content

Automate your facebook chats [JUST FOR FUN]

Hola folks!
 We all are on Facebook, yeah, and many times it happens you just don't wish to continue a conversation, reasons can be any and many. Say, you are not in a mood to talk, or though its a good friend who pinged, you are engrossed in some work in the parallel tabs and fb was just left open and hidden amongst the enormity of other tabs or may be its just another unwanted "hii .." (or maybe you are simply excited to automate the chat messages rather than responding in person).

Here is a way to deal with all those in a humane and polite way :)

Preferred browser: Chrome

Do this :
1. In the chatbox settings, click on "See Full Conversation"
2. Press F12 and write the code in console, make sure to make a necessary change before hitting enter, that is,  changing your reply button ID, since for every pageload on FB, this seemingly changes. Usually it is u_0_x though, but do inspect element on Reply Button and copy the id of the button and properly put it in the code.
3. Press Enter and let the fun begin.

var dialogs  = ["hey! ssup?", "oh okay", "nothing much at my end", "btw check out this standup comedy by Biswa " , "kk", "ahaan", "dude, wait, I will brb", "gotta go, catch you later, bbye :) "];
    var chatBox  = document.getElementsByName("message_body")[0];  
    var replyBut = document.getElementById("u_jsonp_3_6");   //change this id , this may not match
    var diaNum=0;

    var chitInt   = setInterval(function() {
        chatBox.value = dialogs[diaNum] ;
        }, 4000);
      if (diaNum == 8) {
    }, 60000);

Feel free to play around with the code on my github repo here
Essentially this code is trying to put the dialogs in the array one by one in the chat box. So it starts with "hey!! ssup?" and end by "gotta go, catch you later, bbye :) ". Change these dialogs according to your chatting style to make it more realistic. Close the webpage to stop the script in between.
Also, for now it is one dialog every minute, change depending on the typing speed and availability of your friend (before starting the script).
Don't make it too less otherwise FB will pop up security check to assure its not a robot.

Personally, I got some really unexpected replies on these chats, like "Is this Aditi?" or "what's wrong with your texting language be? ". I needed to type in at times but it was fun overall.
Warning: People will leave frustrated or will be annoyed at times , so , sometimes you need to carry on a real chat just to make them normal and happy again.

I thank to all my friends, for tolerating the irrelevant messages while I was testing the script. Though some of them still don't know it was a script that conversed with them ( O yea B| ) .I am sorry.

PS: 1. Try at your own risk. In case FB blocks you or something crashes, its your responsibility.
2. Its meant for purely educational purposes :D

See you soon in the next post!

Happy Hacking!



  1. I will ask Mark Zuckerberg to block eval and no script on facebook so that people like you could not play with emotions of innocent souls :P

    1. "PS: Its meant for purely educational purposes :D" You are not motivated to play with the emotions by using this script. Please assure. :)


Post a Comment

Popular posts from this blog

Duh - Saves you the trouble to correct your command


This is no more an expression for me but a command now. Thanks to the hack I have been doing for past couple of days.

What's it about? Well, here it goes.

How many times it happens that we screw up commands on terminal?
A typo, a syntax mistake or jumbled up arguments. The command doesn't run and then we spend time retyping it ensuring everything is in place this time.
Quite time consuming, eh?

My laziness simply denied me such a behaviour. So I coded up a powershell cmdlet which can do this for me.
Now if I mess up a command, I just have to type 'Duh' and the right command will be displayed on the prompt for you to check and execute (press ENTER).

How Duh operates internally?
Well, guess what. Answer lies in the "tries".
We have a trie and we do closest match using Leveinshtein Distance.
In short, how to figure out how close two strings are?  Find the no of letters you need to remove/insert/replace in order to attain string 2 from string 1.
This is wha…

How would you make an HTML Parser?

Hola folks,

Here we will be walking through how html is being parsed by a widely popular parser: Angle Sharp
You can find it here !
This is just a walkthrough and gives an idea on the breadth of issues  one has to deal with while designing a parser.

Let's sneak peek into what kind of data structures are used and how is the code structured.

It all begins with this line:
var parser = new HtmlParser();
We have folowing variations in constructing the HtmlParser object:

  public HtmlParser()
            : this(Configuration.Default)

        /// <summary>
        /// Creates a new parser with the custom options.
        /// </summary>
        /// <param name="options">The options to use.</param>
        public HtmlParser(HtmlParserOptions options)
            : this(options, Configuration.Default)

        /// <summary>
        /// Creates a new parser with the custom configuration.
        /// </summary&…

What emotions run through your playlist?

Hola !!

Long time. So I was upto creating this application one night , I named: "Playlist Emotions" , "What does the song says" :P , "PlayWithEmotions" and what not, each project of a failed experimentation.


The project took way too long. Thanks to the noble idea of making and deploying it as a GWT application and then to improve upon the GUI of the app.
FYI , I tried but done neither of the things above. My Google Console developers trial account  supposedly has some issues with this app, yet to be resolved. So before the entire idea behind the app and the excitement of results it displays fades out , I thought, lemme write a blog post on the same.

So what is this all about?

The idea originated from a candid discussion with my friend on how songs influence our moods and also how our emotions affect the type of songs we listen to.

Being fascinated about knowing what kinds of songs I listen to, I thought of creating an application where I would just e…