Skip to content

Instantly share code, notes, and snippets.

@0leynik
Last active December 27, 2018 11:57
Show Gist options
  • Save 0leynik/3bd2cf8e01c8ca8aa48848a99f7a05e1 to your computer and use it in GitHub Desktop.
Save 0leynik/3bd2cf8e01c8ca8aa48848a99f7a05e1 to your computer and use it in GitHub Desktop.
(function(){
'use strict';
if (!confirm('Delete?')) return;
//posts
//var deletePostLink = document.body.querySelectorAll('a.ui_actions_menu_item[onclick^="wall.deletePost"]');
//gifts
// var deletePostLink = document.body.querySelectorAll('a.gift_delete[onclick^="Gifts.deleteGift"]');
//videos
//var deletePostLink = document.body.querySelectorAll('div.video_thumb_action_delete[onclick^="return Video.onVideoDelete"]');
//docs
// var deletePostLink = document.body.querySelectorAll('div.docs_action_icon[onclick^="return Docs.deleteItem"]');
//likes
var deletePostLink = document.body.querySelectorAll('a.like_btn[onclick^="Likes.toggle"]');
for (var i = 0; i < deletePostLink.length; i++)
{
deletePostLink[i].click();
}
alert('Deleted ' + deletePostLink.length);
}());
//audios
// 1
var script= document.createElement("script");
script.src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",script.type="text/javascript",
document.getElementsByTagName("head")[0].appendChild(script);
// 2
jQuery('.audio_row').each(function(i,el){
var audio = $(this).data('audio'),
$hash = audio[13].split('/');
$.ajax({
url: "https://vk.com/al_audio.php",
method: "POST",
data: {
act: 'delete_audio',
aid: audio[0],
al: 1,
hash: $hash[3],
oid: audio[1],
restore:1
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment