Subdue Metafilter Titles

Makes titles on the Metafilter front page smaller, and moves them to the "posted by" line.

As of 2014-05-24. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Subdue Metafilter Titles
// @namespace   http://example.com/SubdueMetafilterTitles
// @description Makes titles on the Metafilter front page smaller, and moves them to the "posted by" line.
// @include     http://www.metafilter.com/
// @include     http://www.metafilter.com/*?page=*
// @include     http://ask.metafilter.com/
// @include     http://ask.metafilter.com/*?page=*
// @include     http://metatalk.metafilter.com/
// @include     http://metatalk.metafilter.com/*?page=*
// @version     1
// ==/UserScript==

var posttitleDivSnap = document.evaluate(
	"//div[contains(concat(' ', @class, ' '), ' posttitle ')]",
	document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < posttitleDivSnap.snapshotLength; i++) {
	var posttitleDiv = posttitleDivSnap.snapshotItem(i);

    var posttitleLinkSnap = document.evaluate("a", posttitleDiv,
        null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
    if (posttitleLinkSnap.snapshotLength != 1) {
        continue;
    }
    var posttitleLink = posttitleLinkSnap.snapshotItem(0);
    var metafilterIndex = posttitleLink.href.indexOf("metafilter.com");
    if (metafilterIndex < 0) {
        continue;
    }
    var relativeLink = posttitleLink.href.substring(metafilterIndex + 14);
    

    var smallcopyLinksToSameSnap = document.evaluate(
        "//span[contains(concat(' ', @class, ' '), ' smallcopy ')]" +
        "//a[@href='" + relativeLink + "']",
        document, null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

    for (var j = 0; j < smallcopyLinksToSameSnap.snapshotLength; ++j) {
        var smallcopyLinkToSame = smallcopyLinksToSameSnap.snapshotItem(j);
        var parentSpan = smallcopyLinkToSame.parentNode;
        if (parentSpan.innerHTML.indexOf("posted by") == 0) {
            parentSpan.innerHTML = "<em>" + posttitleLink.innerHTML + "</em>" +
                "<br/>" + parentSpan.innerHTML;
            posttitleDiv.parentNode.removeChild(posttitleDiv);
            break;
        }
    }
}