In this article, we are going to learn how to comment automatically in a Facebook post. You can use this method to wish your friends a happy birthday or just comment on anything. It is useful when you want to comment a number of times on a post. You just need to specify the count and message that will be automatically commented on a time-interval. Also, you don’t need to install anything for this method to work.
- Initialize count and message value.
- Then define an interval function which will be called each time.
- Make an input variable that points to the input field of comment section.
- Make a submit variable that points to the comment button.
- Since, comment button is disabled by default, so first enable it.
- Set the message to be written in input.
- Click on the submit.
- Decrement the count.
- If count become zero, then clear the interval function.
- Set the time interval of 10000ms, it means the function will be called after each 10 seconds.
Below are the steps:
- Go to facebook page using m.facebook.com
- Sign in and open any post.
- Open developer mode in Chrome by pressing Ctrl+Shift+I
- Navigate to the console.
- Now, run the below script.
Note: Please ensure that there is stable internet connection available, so that the script runs smoothly. Also ensure to visit facebook with m.facebook.com not www.facebook.com because this script works on mobile version of facebook only.
This tutorial is for educational purpose only, please don’t use it for disturbing anyone or any unethical way.
- HTML | DOM comment() constructor
- PHP | ImagickDraw comment() Function
- Semantic-UI | Comment
- How to auto-resize an image to fit a div container using CSS?
- Facebook WOW emoji using HTML and CSS
- How to select and upload multiple files with HTML and PHP, using HTTP POST?
- Get and Post method using Fetch API
- How to get form data using POST method in PHP ?
- Simple POST request using the fetch API
- How to post data using file_get_contents in PHP ?
- POST request using AJAX by making Custom HTTP library
- Simple GET and POST request using Fetch API method by making custom HTTP library
- How to set the div height to auto-adjust to background size?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.