批量删除gitee的代码库
先获取令牌,然后再console中执行。
(async function() { let resp = await fetch("https://gitee.com/api/v5/users/yourname/repos?access_token=#your_token_string#&type=all&sort=full_name&direction=asc&page=1&per_page=100", { "headers": { "accept": "application/json, text/plain, */*", "content-type": "application/json;charset=utf-8" }, "referrer": "https://gitee.com/api/v5/swagger", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET", "mode": "cors", "credentials": "include" }); let list = await resp.json(); let fetchurls = list.filter((v,i)=>v.full_name.indexOf('/cto-') > 0).map((v,i)=>'https://gitee.com/api/v5/repos/' + v.full_name + '?access_token=#your_token_string#'); for (var i = 0, c = fetchurls.length; i < c; i++) { let url = fetchurls[i]; await fetch(url, { method: 'DELETE', headers: { "Content-Type": "application/json;charset=UTF-8" } }) } console.log('ok') } )();
QQ:273352165
evlon#126.com
转载请注明出处。