2013-05-13 69 views
12

数十个问题已经输入我的项目在github上没有地方。一些爱因斯坦运行了一个脚本,并通过api创建了所有这些无关紧要的问题。没有任何东西与这些问题有关。Github - 删除输入错误的问题

当然有一些我可以删除它们,但我似乎无法在文档中找到它。

+0

你不只是要关闭它们的原因吗? – Cairnarvon 2013-05-13 17:21:30

+1

我猜他想删除它们,所以他可以重新输入它们,以便它们被链接。据我所知,你所能做的就是解决问题。我找不到实际移除它们的方法。 – 2013-05-13 17:23:25

+0

我可以做到这一点,但然后它会说我有200封闭的问题,当真的只有100,它看起来像一个灾难与所有荒谬的标题... – 2013-05-13 17:23:26

回答

9

没有办法实际删除问题。你可以做的,表明这是一个垃圾邮件攻击,是创建一个新的标签。然后,您可以使用API​​将edit的每个问题关闭,并标记为SPAM标签。那些看着它的人​​会看到标签旁边显示的标签,这真的是你所期望的最好的。

如果您对某种特定语言更加熟悉,请检查书写的library以使您的生活更轻松。

+2

这是我想到的/担心的。谢谢大家。 – 2013-05-13 19:51:09

+1

您也可以[阻止用户](https://help.github.com/articles/blocking-a-user)防止他/她在您的存储库中打开任何其他问题。 – jasonrudolph 2013-05-14 17:24:24

0

由于法律问题,我不得不用一些项目的许多评论来删除几个问题。我做了如下:

  1. 删除所有评论
  2. 编辑问题的文本(“这个问题是删除与封锁”)
  3. 阻塞问题

复制粘贴在浏览器地址栏上:

javascript:(function(){ $('.delete-button.octicon.octicon-x.js-comment-delete').each(function(){ href=$(this).attr("href"); if(href!==undefined) { console.log("DELETING: "+href); $.ajax({type:"DELETE",url:href}); } }); firstCommentToedit=$('form.js-comment-update')[0]; $.ajax({ type:"POST", url:firstCommentToedit.action, data:{ _method:$(firstCommentToedit).find('input[name=_method]').val(), "issue[body]":"THIS ISSUE WAS DELETED AND BLOCKED", authenticity_token:$(firstCommentToedit).find('input[name=authenticity_token]').val() } }); lockLink=$('a[href$="/lock"]')[0]; if (lockLink!==undefined) { $.ajax({ type:"POST", url:lockLink.href, data:{_method:$(lockLink).attr("data-method")} }); } setTimeout(function(){window.location=window.location;},3000) })() 

扩展:

javascript: (function() { 
 
    $('.delete-button.octicon.octicon-x.js-comment-delete').each(function() { 
 
     href = $(this).attr("href"); 
 
     if (href !== undefined) { 
 
      console.log("DELETING: " + href); 
 
      $.ajax({ 
 
       type: "DELETE", 
 
       url: href 
 
      }); 
 
     } 
 
    }); 
 
    firstCommentToedit = $('form.js-comment-update')[0]; 
 
    $.ajax({ 
 
     type: "POST", 
 
     url: firstCommentToedit.action, 
 
     data: { 
 
      _method: $(firstCommentToedit).find('input[name=_method]').val(), 
 
      "issue[body]": "THIS ISSUE WAS DELETED AND BLOCKED", 
 
      authenticity_token: $(firstCommentToedit).find('input[name=authenticity_token]').val() 
 
     } 
 
    }); 
 
    lockLink = $('a[href$="/lock"]')[0]; 
 
    if (lockLink !== undefined) { 
 
     $.ajax({ 
 
      type: "POST", 
 
      url: lockLink.href, 
 
      data: { 
 
       _method: $(lockLink).attr("data-method") 
 
      } 
 
     }); 
 
    } 
 
    setTimeout(function() { 
 
     window.location = window.location; 
 
    }, 3000) 
 
})()

+0

项目#3做什么? – Gaia 2016-10-05 07:41:48

+0

@Gaia我编辑了答案。代码是自动完成上述步骤的“快捷方式”。我不知道它是否仍然有效(取决于GitHub是否更改了类名)。 – aabilio 2016-10-05 08:41:50

+0

示例:使用此方法发布“已删除”:https://github.com/aabilio/PyDownTV2/issues/135 – aabilio 2016-10-05 08:48:03