2013-05-13 48 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