21

Please note, the tag burninator script requires 10k rep to use. Sorry, noobs!

I pass on to you, dear taxonomist terrorists, the burninator toolkit.

Burninator signal

This toolkit consists of two user scripts which, when configured and used in conjunction, can chew up and spit out whatever tag needing burnination faster than you can believe.

The first user script can be located at this gist(install). Its goal is to allow you to easily open up many questions that have the same tag. The reason for this will be revealed later.

You use this script by visiting the list of questions for a particular tag. For example, let's use this awful disgusting tag: {education}.

This userscript adds a clickable div to the top of the list:

new div shown

Which, when clicked, expands to show links to all questions on that page:

list of links displayed

When you are using this script for tag eradication, simply ctrl-click (or whatever the equivalent is for your particular keyboard) on the first link to open that in a new tab. Clicking on the link also removes it from the list.

clicking links

By just holding the mouse and hitting ctrl-click repeatedly you can open up all questions on the page in other tabs in under a minute.

You may be asking me, "why would I want to do this?" I'll tell you.

You would want to do this so that the other half of the kit, this user script right here, can automatically edit out the tag and, optionally, cast a delete vote on it. All without any effort on your part. Yep.

There isn't anything photogenic about this half of the process, so let me illustrate the feeling you get from ripping a crap tag from fifty questions in under a minute:

Overrated "actor"

The script comes preconfigured with many tags that plain old suck. There are ones that just need to be removed from questions,

var tagsThatShouldJustBeRemoved = 
    ["mmorpg", 
    "authors",
    "technologies",
    "code-reading",
    "teaching",
    "information",
    "guide",
    //etc

and the ones that indicate the question should be nuked from orbit (proven to be the only way to be sure)

var tagsThatGetYouDeleted = 
    ["education",
    "suggestions",
    "books",
    "ebook",
    "exam",
    "tutorials",
    "tutorial",
    "oreilly-book", ];

You can personalize your targets to suit your needs. In fact, you should personalize both lists of tags before you use this script. Please note that your edit will happen asynchronously, will run on every question you view, and unless you cast a delete vote you will not know anything happened. Also, if tag removal would result in the question not having any tags, you will be informed by an annoying alert. You'll have to retag it manually :/.

One last warning, you will hit a rate limit if you open fifty tabs one after another. Keep it to about one per second, or more if you're voting to delete after every edit.

Now, install these scripts, go forth, and burn!


Updates

Tag List:
1.0 First release
1.1 Move all closed questions to the front of the list
- Rip through these, then burn the window. No need to examine closed questions.
1.2.4 Updated to work with the new UI by Mogsdad
1.2.10 Updated to work with new Nav by Mogsdad

Tag Burninator:
1.0 First release

7
  • This has stopped working with the recent UI changes.
    – Mogsdad
    Commented Aug 29, 2015 at 4:34
  • @Mogsdad it'll be a while before I fix it. If you want to use it now, the changes probably aren't that radical.
    – Ripped Off
    Commented Aug 31, 2015 at 12:47
  • True - appears that URLs and element ids have changed. Was just hoping you were still using it (and were therefore forced to fix it yourself ;) No prob. Adding the new match URLs was easy, I haven't completed the element ids correctly yet; I'm not sure what the old-new mapping is (...don't have old pages). Will send a pull request if/when I get it sorted.
    – Mogsdad
    Commented Aug 31, 2015 at 13:03
  • @Mogsdad appreciate!
    – Ripped Off
    Commented Aug 31, 2015 at 13:36
  • Updated gist - see comment
    – Mogsdad
    Commented Sep 20, 2015 at 2:53
  • There are too many good lines in here! useful script, and a great description.
    – David
    Commented Dec 17, 2017 at 21:21
  • Not sure if you still maintain the userscript, but for me, it creates two entries for each question. As in every link is duplicated in the tag list. I managed to fix it locally by removing ,.result-link from App.hrefs = App.root.find('.question-hyperlink,.result-link');, but it seems kinda hackish. And also a bug that should be fixed.
    – user51156
    Commented Nov 23, 2018 at 16:49

2 Answers 2

9

Inline tag edit requires 10k rep, but 2k rep is enough to edit questions (therefore, do retags). However, inline API is much easier - you just do the post, which contains tags only. Doing full edit requires accessing postable questions body.

I've done quick modification to your script. It's a draft, but working for me... it activates edit mode, waits until it activates and manually un-clicks wrong tags, then clicks submit.

Some parts of code, especially final click may not work because of longer loading time. I know it could be improved. But if I have more time for it, I'd rewrite retagging mechanics. We should be able to do more advances things, namely retagging instead of burninate.

For example, tag [get] is used for many things, for example http get. So if something is tagged [get] and [http], it should be retagged to [http]+[http-get].

This is the modified code:

var id = document.location.href.match(/\d+/);
var rep = $('.reputation-score').first().text().replace(',','')

// posts your edit, and votes to delete if the question sucks, but it requires 10k rep
if (rep >= 10000) {
// here goes your ajax post
} else {
    // users with lower rep require to do the whole cycle: click edit link, wait for
    // edit mode to load, then retag
    $('.postcell a.edit-post').click()
    var removeTags = function() {
        // click delete-tag on each tag from those that are forbidden
        $('.tag-editor .post-tag').each(function(i,el){
            var tag = $(el).text()
            for (var i=0;i<tagsThatShouldJustBeRemoved.length;i++) {
                if (tagsThatShouldJustBeRemoved[i] == tag) {
                    $(el).find('.delete-tag').click()
                }
            }
        })
        var submit = function() {
            $('.inline-editor .form-submit input').each(function(i,el){
                if (el.value == 'Save Edits') $(el).click()
            })
        }
        setTimeout(submit, 500)
    }
    var waitForEdit = function() {
        if ($('.tag-editor').size()) 
            removeTags()
        else
            setTimeout(waitForEdit, 1000)
    }
    waitForEdit()
}
0

A version that replaces tags, too!

Here's my version of the "update page" script that will:

  • Delete tags defined in tagsThatShouldJustBeRemoved
  • Replace tags defined in tagsToReplace
  • Adds a * to the page title to indicate that the tags were updated

.

// ==UserScript==
// @name       Burn/replace tags
// @version    1.0
// @description  Replace/Delete tags
// @match      https://stackoverflow.com/questions/*
// ==/UserScript==

// Only run on pages with questions (question number in URL)

if ('0123456789'.indexOf(window.location.pathname.charAt(11)) === -1) return;

function exec(fn) {
    var script = document.createElement('script');
    script.setAttribute("type", "application/javascript");
    script.textContent = '(' + fn + ')();';
    document.body.appendChild(script); // run the script
    document.body.removeChild(script); // clean up
}

window.addEventListener("load", function () {

    // script injection
    exec(function () {

    /* add other tags that should get REMOVED but don't indicate the question is deletable */
    var tagsThatShouldJustBeRemoved = ["amazon"];
    var tagsToReplace = {'aws-athena':'amazon-athena'};
    var tags = $(".post-taglist .post-tag").map(function () { return $(this).text(); }).get();
    var toSave = [];

    $.each(tags,
           function (index)
           {
               if (tags[index] in tagsToReplace)
                   toSave.push(tagsToReplace[tags[index]]);
               else if ($.inArray(tags[index], tagsThatShouldJustBeRemoved) === -1)
                   toSave.push(tags[index]); // save it
           });

    // No change? Exit!
    if (toSave.toString() == tags.toString()) return;

    // No tags? Tell user.
    if (toSave.length === 0){
        alert('This question has nothing but bad tags on it.  Either figure out a valid tag or flag and ask a mod to delete it if it is hopeless.');
        return;
    }

    var id = document.location.href.match(/\d+/);

    // Saves new tags
    $.ajax({
        type: "POST",
        url: "https://stackoverflow.com/posts/" + id + "/edit-tags",
        data: { fkey: StackExchange.options.user.fkey, tagnames: toSave.join(" ") },
        success: function (x, status, error)
        {
            // Indicate update by adding a * to title
            document.title = '*' + document.title;
        },
        error: function (x, status, error)
        {
            alert(status + "\\n" + error);
        },
    });

    });
}, false);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .