Shell script to open multiple chrome windows with auto close command
Hi, This is Shubham Mishra from India, this is the part of Ruby on Rails exploration journey. In this post we will discuss about the shell script code to open multiple chrome windows and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started...
In this blog we will going to write a shell script to open N number of url's in a new Chrome incognito windows. Some times we want to test load on our websites or want to increase the view count of our youtube videos then we need some automations, here the actual requst is : "Write a shell script for opening new incognito window of chrome from list of urls in random manner, and also keep random sleep time between 1 minute to 10 minute for next iteration and also close the opened window after 3 minutes" This is how the script functions: 1. Set the URL list to open. 2. cycle over each URL. 3. Set a random sleep period of between one and ten minutes. 4. Use the google-chrome command along with the —incognito and —new-window parameters to open a new incognito window of Chrome with the specified URL. The command is executed in the background thanks to the & at the end. 5. Use the sleep command to take a random amount of sleep. 6. Using the sleep command with a 3 minute duration and the wmctrl -c command to close the window, you can close the Chrome window after 3 minutes. The wmctrl package must be installed in order to use the wmctrl -c command. And to install the dependent package, command is already mentioned in above script at the end inside comment section This way you can run your youtube videos OR open blogs to increase the view count. You can alter the numbers above to change the sleep time. You can enclose entire script into another loop to run it for N number of times, like for 50 times can enclose it inside, for ((i=1;i<=50;i++)); do done You can explore my previous blog: Max Heap create and sorting Or you can explore my other blogs too here,Get to know answers for common search on Google : A blog for posts which can help you for daily life problems, such as where to get free images, Topic suggestion for the blog.
Computer Science algorithms and other knowledge share : A blog for posts such as best search algorithm, Top interview questions for diffrent technologies, knowledge share for some frameworks or programming languages for the interview or in general terms.
My ideas to solve real world problems : A blog where me shared and presented my ideas to solve a real world problems, this will be interesting for me.
Ruby on Rails Web development Blog : As the name suggest, it is the blog for sharing few knowledge about RoR web development framework.
Liked my blogs, wanna to connect:
Thanks for reading this post, Have a good day :)
Comments
Post a Comment