-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpleaseDeleteContributionsPlease.js
59 lines (50 loc) · 2.22 KB
/
pleaseDeleteContributionsPlease.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Google Maps - Delete All Contributions
// 1. Go to Google Maps, on your desktop
// 2. Open the left tab menu
// 3. Click on "Your contributions"
// 4. Select the tab "Photos" or "Reviews"
// 5. Scroll down until all or most of all pictures (or reviews) are shown in list
// 6. Open the Developer tools (F12, on Firefox or Chrome)
// 7. Open the Console tab
// 8. Copy Paste this script
// 9. Type pleaseDeleteContributionsPlease(), wait for it to be done.
var pleaseDeleteContributionsPlease = function () {
var confirmDeleteContribution = function() {
[...document.querySelectorAll('button[class~="blue-button-text"]')].forEach( (a) => {
a.style.border = "thick solid red";
a.click();
});
setTimeout(removeMe, 5000);
}
var deleteContribution = function() {
[...document.querySelectorAll('div[role="menuitem"][class="action-menu-entry"] > div[class="action-menu-entry-text"]')].forEach( (a) => {
if (a.innerHTML.includes("Delete")
|| a.innerHTML.includes("Elimina")) {
a.parentElement.style.border = "thick solid red";
a.parentElement.click();
}
});
setTimeout(confirmDeleteContribution, 600);
}
var removeMe = function() {
var elem = items[currentIndex];
if (currentIndex < numberOfItems && elem) {
elem.style.border = "thick solid red";
elem.click();
// goes to the next item
currentIndex = currentIndex + 1;
console.log('task:', currentIndex, 'of', numberOfItems);
// set to delete the item
setTimeout(deleteContribution, 600);
} else {
clearTimeout();
console.log('DONE. You did a favor to your past and present self. Now, go print one of your favorite pictures and hang it on a wall, please.');
}
};
// these are used inside the above functions
var currentIndex = 0;
var items = [...document.querySelectorAll('button[class*="action-menu"]')];
var numberOfItems = [...document.querySelectorAll('button[class*="action-menu"]')].length;
// start iterating through `items`
removeMe();
}