Skip to content

Instantly share code, notes, and snippets.

@jt-wang
Last active December 24, 2016 15:35
Show Gist options
  • Save jt-wang/2f62f2f41dbd31df768262b86140e9d7 to your computer and use it in GitHub Desktop.
Save jt-wang/2f62f2f41dbd31df768262b86140e9d7 to your computer and use it in GitHub Desktop.
删除豆瓣相关
javascript: void(function() {
/*删除书影音*/
/*you can replace this with "movie" or "music"*/
var douban_type = "book";
var send_delete = function(sid) {
$.post_withck("https://" + douban_type+ ".douban.com/j/mine/j_cat_ui",
{sid: sid})
};
if ($("a.d_link").length > 0) {
$("a.d_link").each(function() {
send_delete($(this).attr("rel"));
$(this).hide();
});
location.reload();
}
})();
javascript: void(function() {
/*删除相册*/
var send_delete = function(url) {
$.post_withck(url + "delete")
};
if ($("a.album_photo").length > 0) {
$("a.album_photo").each(function() {
send_delete($(this).attr("href"));
$(this).hide();
});
location.reload();
}
})();
javascript: void(function() {
/*删除喜欢*/
var send_delete = function(datatid, datatkind) {
$.ajax({
url: '/j/like',
type: 'DELETE',
data: {
tid: datatid,
tkind: datatkind,
ck: get_cookie("ck")
},
});
};
if ($("a.gact.lnk-delete").length > 0) {
$("a.gact.lnk-delete").each(function() {
send_delete($(this).attr("data-tid"), $(this).attr("data-tkind"));
$(this).hide();
});
location.reload();
}
})();
javascript: void(function() {
/*删除活动*/
var re = /^.*douban\.com\/event\/\d+\/$/;
var send_delete = function(url) {
$.get(url + "?interest=do_cancel", {
ck: get_cookie("ck")
})
.success(function(){}).done(function(){});
};
if ($("li.list-entry div.info div.title a").length > 0) {
$("li.list-entry div.info div.title a").each(function() {
if ($(this).attr("href").match(re)) {
send_delete($(this).attr("href"));
}
});
location.reload();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment