Skip to content

Instantly share code, notes, and snippets.

@chirag64
Last active January 1, 2018 11:31
Show Gist options
  • Select an option

  • Save chirag64/34ca715aacd3c86ff5ef4fd7e97175ad to your computer and use it in GitHub Desktop.

Select an option

Save chirag64/34ca715aacd3c86ff5ef4fd7e97175ad to your computer and use it in GitHub Desktop.
Load the webpage with all restaurants that deliver at your desired address (like https://www.swiggy.com/mumbai/restaurants) with all restaurants loaded on the web page (keep scrolling down till it loads all) and then run the script. For 1 time use, copy-paste the code of unminified file in your browser console. For regular use, create a bookmark…
javascript:(function(){var r=$(".restaurant-container:not(:has(.closed))");r.css("border","");var o=Math.floor(Math.random()*r.length);r[o].style.border="3px solid red";r[o].scrollIntoView();})();
// Load the webpage with all restaurants that deliver at your desired address (like https://www.swiggy.com/mumbai/restaurants) with all restaurants loaded on the web page (keep scrolling down till it loads all) and then run the script.
var restaurants = $('.restaurant-container:not(:has(.closed))');
restaurants.css('border', '');
var randomNumber = Math.floor(Math.random() * restaurants.length);
restaurants[randomNumber].style.border = '3px solid red';
restaurants[randomNumber].scrollIntoView();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment