Skip to content

Instantly share code, notes, and snippets.

@lpnam0201
Created April 2, 2017 15:33
Show Gist options
  • Save lpnam0201/d11724ad76e420922f30439c18a59af6 to your computer and use it in GitHub Desktop.
Save lpnam0201/d11724ad76e420922f30439c18a59af6 to your computer and use it in GitHub Desktop.
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