1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// ==UserScript==
// @name         plurk Custom CSS Overrider
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  fucking shit CSS
// @author       NOKO
// @match        https://www.plurk.com/*
// @grant        GM.registerMenuCommand
// ==/UserScript==

(function() {
    'use strict';
    var user_id = SiteState.getSessionUser().id || 0;
    var regex = /(user_id=)\d*/;
    var customCSS = document.head.querySelector('link[href*=getCustomCss]');
    if(!customCSS)
    {
        customCSS = document.createElement('link');
        customCSS.rel="stylesheet";
        customCSS.type="text/css";
        customCSS.id="theme-custom";
        customCSS.href="https://www.plurk.com/Users/getCustomCss?user_id=";
        document.head.appendChild(customCSS);
    }
    GM.registerMenuCommand("CustomCSS",function(){
        customCSS.href = customCSS.href.replace(regex, "$1"+user_id);
    });
})();