Wordpress.com-Anti-GlobalTags

By zodiac1978 Last update Oct 22, 2008 — Installed 67 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0
// ==UserScript==
// @name           Wordpress.com-Anti-GlobalTags
// @namespace      Wordpress.com
// @description    Wordpress.com-Tag- und Kategorie-Links auf Blog umbiegen
// @include        http://*.wordpress.com/* 
// ==/UserScript==

var allTagLinks, thisTagLink; 
allTagLinks = document.evaluate( 
    "//a[@rel='tag']", 
    document, 
    null, 
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, 
    null); 
    
for (var i = 0; i < allTagLinks.snapshotLength; i++) { 
    
    thisTagLink = allTagLinks.snapshotItem(i); 
    var Blogname = window.location.host; 
    // do something with thisTagLink
    thisTagLink.href = thisTagLink.href.replace(/de.wordpress.com/g, Blogname);
    // Ende
} 

var allCatTagLinks, thisCatTagLink; 
allCatTagLinks = document.evaluate( 
    "//a[@rel='category tag']", 
    document, 
    null, 
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, 
    null); 
    
for (var i = 0; i < allCatTagLinks.snapshotLength; i++) { 
    
    thisCatTagLink = allCatTagLinks.snapshotItem(i); 
    var Blogname = window.location.host; 
    // do something with thisTagLink
    thisCatTagLink.href = thisCatTagLink.href.replace(/de.wordpress.com\/tag/g, Blogname + "/category");
    // Ende
}