Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function test()
{
var rows = document.querySelectorAll('#year_2014 .pam._5shk');
for (var k = 0; k < rows.length; k++) {
var row = rows[k];
var editButton = row.querySelector('._42ft._42fu._4-s1._2agf._p._42gx');
editButton.click();
var possibleDeleteLinks = document.querySelectorAll('a[ajaxify]');
for (var i = 0; i < possibleDeleteLinks.length; i++) {
var link = possibleDeleteLinks[i];
if (link.getAttribute('ajaxify').startsWith('/ajax/timeline/all_activity/remove_content.php') && link.getAttribute('ajaxify').contains(row.id)) {
var prev = row.querySelector('.fsm');
if (prev != null)
console.log('DELETING (' + row.id + ') ' + prev.textContent);
else
console.log('DELETING (' + row.id + ')');
link.click();
break;
}
}
}
}
test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment