Skip to content

Instantly share code, notes, and snippets.

@hisivasankar
hisivasankar / google-holi-2020-automation.js
Last active Mar 10, 2020
Playing Google Holi 2020 - Automation
View google-holi-2020-automation.js
// Simulate click behaviour based on x, y coordinates
function click(x, y) {
let elm = document.querySelector("canvas.ZRgdub");
let ev = document.createEvent("MouseEvents");
ev.initMouseEvent( "click", true, true, window,
0, 0, 0, x, y,
false, false, false, false,
0, null
);
elm.dispatchEvent(ev);
@hisivasankar
hisivasankar / DeleteTweets.js
Created Jun 10, 2019
Delete Tweets based on some condition
View DeleteTweets.js
const condition = ''; // eg. '<some-content>'
const targetClassToFindInfo = ''; // Eg '.tweet-text'
$('li.js-stream-item').each(function(index, tweet) {
const text = $(tweet).find(".content " + targetClassToFindInfo)[0].innerText;
if(text.indexOf(condition) > 0) {
$(tweet).find('.js-actionDelete').click();
$('.delete-action').click();
}
});