惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
小众软件
小众软件
Last Week in AI
Last Week in AI
月光博客
月光博客
博客园 - 聂微东
Recent Announcements
Recent Announcements
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
云风的 BLOG
云风的 BLOG
量子位
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
博客园 - 司徒正美
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享

博客园 - 阿牛

在家无缝访问公司内网:我的低成本、高安全远程办公方案 好学生 Deepseek 的学习过程 DeepSeek R1 的推理过程与人类团队处理任务的类比 ColorOS14升级15保持ROOT windows11获取不到IPv6的解决方法 wps插件工具 当github双因子认证遇到鸿蒙手机 从Console中获取VUE的Route参数 雨霖工具 使用Powershell脚本实现微信多开 调试远程GithubAction 突破Vecel网站最大运行10秒的限制 备份51CTO买到的视频课程 白嫖Gitee收费服务, 实现瞬时Pages更新 PC微信小程序解密和反编译资源 批量删除gitlab仓库 批量删除github仓库 树莓派系统充分利用SD卡空间 Thinkpad T470p Clover and opencore 吃黑苹果 Catalina 10.15.5
批量删除gitee的代码库
阿牛 · 2021-08-22 · via 博客园 - 阿牛

先获取令牌,然后再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')
}
)();