如何删除知乎回答
先用Fiddler抓取request请求
DELETE https://www.zhihu.com/api/v4/answers/1591480574 HTTP/1.1
Host: www.zhihu.com
Connection: keep-alive
x-zst-81: 3_2.0ae3TnRUTEvOOUCNMTQnTSHUZo02p-HNMZBO8YDRybXtuQ_F0K6P0EQuy-LS9-hp1DufI-we8gGHPgJO1xuPZ0GxCTJHR7820XM20cLRGDJXfgGCBxupMuD_Ie8FL7AtqM6O1VDQyQ6nxrRPCHukMoCXBEgOsiRP0XL2ZUBXmDDV9qhnyTXFMnXcTF_ntRueThiHCXuXLSUC1Jge_ECOG6qXCthwMZvHG-DNLS9NMxwwsrvO_dwNBrJVMnwLPv4OmkqCfShcqguV9D921_Go0srx9VUxMpgNGMBCqAJc0LDgBywL97BcGqrcVguosOUxCTBxf-qeqgwtMPUOYRqtYNUSLNUps1w2fYAXLHqoCQLc1fuFC5qfz-UuOfgwVoGY8QvOm-wHK6GYGwUeCfDg9brCGOgtsrDp9QrLYqvOffGVfSU2Y1BgCAuH8nUC9DB2LmHg9igH1QTxYuqg8iBwBAwOy09HY1qw0-weLWr3C
x-ab-param: li_sp_mqbk=0;tp_zrec=1;pf_noti_entry_num=2;li_video_section=0;tp_contents=2;qap_question_visitor= 0;pf_adjust=1;li_vip_verti_search=0;tp_topic_style=0;li_edu_page=old;top_test_4_liguangyi=1;li_paid_answer_exp=0;se_ffzx_jushen1=0;li_panswer_topic=0;qap_question_author=0;zr_slotpaidexp=1;tp_dingyue_video=0;zr_expslotpaid=1
x-ab-pb: ClAIABgBDwxHADQMlgvFALQAAQvkCvQL4Qu1CxsAdQxSC2cA5gA3DEIAAAEPC7QKmwu3AAEBVgwHDNwL4AtoANcLbACkAM8LYAuJDD8A7ApMCxIoAgAAAAAAAAAAAAABAwAAAQAAAQUAAQAAAAABAQAAAAAAAQsAAAABAA==
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
x-requested-with: fetch
x-zse-86: 1.0_aTF0ggLBFBNpe_YBs_Oqre98b_FpoRFqTqxqUJLy6HFX
x-xsrftoken: c0XGoDUYoquSMMIVV7Q4E9P1epHGNVr1
x-zse-83: 3_2.0
Accept: */*
Origin: https://www.zhihu.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.zhihu.com/people/chuck-lu-47/answers
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ja;q=0.6
Cookie: _zap=5ab86648-add8-4d87-95aa-36712cf5b5a0; d_c0="AMCRlxVCVxKPTtcB5iYoE2lrOEg4BbHYurI=|1607873440"; capsion_ticket="2|1:0|10:1607879175|14:capsion_ticket|44:ZWQzNzQzMWZkNzJjNGIzOTg1OTZmZTE1MmM4OGQ5ZTc=|716b8446e7168b94d9b60eeba55832c372f85bb184f884ddb4ded0f813329ccc"; r_cap_id="YWU3OGE1MWMxOTEzNGUzNjg5OGEzZGY4OWVjNjIwYmQ=|1607879178|00aee005cf470f357250e584aee9c5cf4d6671b3"; cap_id="ODJiY2MyNDc2MWNlNDAxZDk5MTAxMWVjZDRkOGU2Zjk=|1607879178|c7525b7e91f80926a63dcd1be553697fa843b10a"; l_cap_id="YjMzNTQzMjgyMzNkNDFhOGFkZDRlMjgzNTAwMTI3MDI=|1607879178|effa3b021277b8c4df3a614e07bac1545f4dcde2"; z_c0=Mi4xbkp4dEFRQUFBQUFBd0pHWEZVSlhFaGNBQUFCaEFsVk5McGpEWUFBNW5QSFV6QlowREFJcEZUQU1VRGhtc2FfMzdR|1607879214|bc169e7425d77bc6c2cb0dc9f768eaa6a80bac0c; q_c1=ed1b34dfd23544509ac764bc11ddf34e|1607879215000|1607879215000; tst=f; _xsrf=c0XGoDUYoquSMMIVV7Q4E9P1epHGNVr1; SESSIONID=w7nDpt5iF5EsLdJrWtjuw40FaVC1tdQRga9kKMEJsxG; JOID=U1kXAEoUZdXL869dURbVB_bxjc9DY1G6jYPbazlSUJO5vcsXIEYMKpbzrF9SvPyAZxKBE_vxyUwmpJa8xPYUX20=; osd=UV0RAU0WYdPK9K1ZVxfSBfL3jMhBZ1e7ioHfbThVUpe_vMwVJEANLZT3ql5VvviGZhWDF_3wzk4iope7xvISXmo=; __utma=51854390.1298904642.1610378129.1610378129.1610378129.1; __utmb=51854390.0.10.1610378129; __utmc=51854390; __utmz=51854390.1610378129.1.1.utmcsr=zhihu.com|utmccn=(referral)|utmcmd=referral|utmcct=/question/320200783/answer/1474146144; __utmv=51854390.100-1|2=registration_date=20150503=1^3=entry_date=20150503=1; Hm_lvt_98beee57fd2ef70ccdd5ca52b9740c49=1610328304,1610339174,1610370232,1610378200; unlock_ticket="ABAC1HiCBggXAAAAYQJVTTRz_F-2FDC6scRNfNdBGo8zWxyssNExLQ=="; Hm_lpvt_98beee57fd2ef70ccdd5ca52b9740c49=1610378398; KLBRSID=fe0fceb358d671fa6cc33898c8c48b48|1610378522|1610377997
如何删掉自己所有的答案和想法
(function(pageNumber){ [...document.documentElement.outerHTML.matchAll(/www.zhihu.com\/question\/\d+\/answer\/(\d+)/g)] .map(x=>`https://www.zhihu.com/api/v4/answers/${x[1]}`) .forEach(function(url){ var xhr = new XMLHttpRequest(); xhr.open("DELETE", url); xhr.send(); }); window.location.href=`https://www.zhihu.com/people/excited-vczh/answers?page=${pageNumber - 1}` })(+new URLSearchParams(window.location.search).get('page'))
(function(pageNumber){
[...document.documentElement.outerHTML.matchAll(/www.zhihu.com\/question\/\d+\/answer\/(\d+)/g)]
.map(x=>`https://www.zhihu.com/api/v4/answers/${x[1]}`)
.forEach(function(url){
var xhr = new XMLHttpRequest();
xhr.open("DELETE", url);
xhr.send();
});
window.location.href=`https://www.zhihu.com/people/chuck-lu-47/answers?page=${pageNumber - 1}`
})(+new URLSearchParams(window.location.search).get('page'))
先打开答案的最后一页 https://www.zhihu.com/people/chuck-lu-47/answers?page=16,然后再运行脚本
如何取消点赞
function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function myLoop() { var upVoteButtons = document.getElementsByClassName("VoteButton--up"); var upVoteButtonsLength = upVoteButtons.length; console.log(`button length is ${upVoteButtonsLength}`); for (var i = 0; i <= upVoteButtonsLength; i++) { var currentButton = upVoteButtons[i]; currentButton.click(); await sleep(1000); } } myLoop();
还是用下面这段
window.location.reload(); for (let i = 0; i < 9; i++) { var a= $(".VoteButton--up.is-active"); console.log(a); a.click(); } window.location.reload();
批量取消关注
https://www.zhihu.com/question/following
function unfollow_all(){ var remaining = $(".zg-unfollow").length; if (remaining > 0) { $(".zg-unfollow").first().trigger('click'); setTimeout(unfollow_all, 1000); window.scrollTo(0,document.body.scrollHeight); } } unfollow_all(); /* 作者:知乎用户 链接:https://www.zhihu.com/question/27922502/answer/964383258 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 */
如何取消关注的专栏
https://www.zhihu.com/search?q=%E8%AE%B8%E5%A4%A7%E5%A4%AB%E7%9A%84%E7%89%99%E7%A7%91%E4%B8%93%E6%A0%8F&type=column
唯一有用答案。直接搜索专栏的名字就可以取关了
我的收藏
https://www.zhihu.com/collections
window.location.reload(); for (let i = 0; i < 9; i++) { var a= $(".FollowButton.Button--grey"); console.log(a); a.click(); } window.location.reload();