Monday, October 3
Shadow

Tampermonkey Script

// ==UserScript==
// @name         Concert ticket script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Used for buying ticket!
// @author       Felix
// @match        http://msg.urbtix.hk/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function createCookie(name,value,days) {
        var expires;
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            expires = "; expires=" + date.toGMTString();
        }
        else expires = "";
        document.cookie = name+"=" + value + expires + "; path=/";
    }
    function eraseCookie(name) {
        createCookie(name,"",-1);
    }
    function eraseAllCookie(callback) {
        var cookies = document.cookie.split(";");
        for (var i = 0; i < cookies.length; i++) {
            eraseCookie(cookies[i].split("=")[0]);
        }
        callback();
    }

    if (window.location != "https://ticket.urbtix.hk/internet/") {
        eraseAllCookie(function() {
            window.location = "https://ticket.urbtix.hk/internet/";
        });
    }
})();

Leave a Reply