Don't think so, because it can't retrieve the post ID from a post on the printable version as far as I understand.
Nope, but you can add IDs to the posts!Dusk Voyager said:Don't think so, because it can't retrieve the post ID from a post on the printable version as far as I understand.
// @include http://forums.taleworlds.com/...
// @include *://forums.taleworlds.com/...
For now, existing HTTP links to the forum will load the page as HTTP rather than just redirect to HTTPS. All forum links within the page however will point to HTTPS, other than within user posts and signatures and such.J said:Could also change 'em to https:// but decided to keep it at that, in case somehow you manage to load a http:// version of a page at some point.
// ==UserScript==
// @name exname
// @namespace http://tampermonkey.net/
// @version 0.1
// @description how we got here
// @author You
// @include https://forums.taleworlds.com/index.php?action=mlist;sa=search
// @include http://forums.taleworlds.com/index.php?action=mlist;sa=search
// @grant none
// ==/UserScript==
ns = document.body.getElementsByClassName("navigate_section")[0];
exInp = document.createElement("input");
exBtn = document.createElement("button");
ns.appendChild(exInp);
ns.appendChild(exBtn);
exBtn.innerText= "Get former name";
ssURL = document.head.getElementsByTagName("link")[0].href.match(/\w{1,}/g);
srcTxtr = "url('" + ssURL[0] + "://" + ssURL[1] + "." + ssURL[2] + "." + ssURL[3] + "/" + ssURL[4] + "/" + ssURL[5] + "/" + "images/button_a.jpg" + "')";
lnk = document.createElement("a");
lnk.href = "#";
lnk.innerText="#";
ns.appendChild(lnk);
lnk.style.display = "none";
exBtn.style.backgroundImage = srcTxtr;
exBtn.addEventListener("click",function(){
curUsername = exInp.value;
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "https://forums.taleworlds.com/index.php?action=mlist;sa=search;search="+curUsername+";submit=Search;fields=name", true);
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
rt = this.responseText;
x = rt.match(/a href[ ]{0,}[=]{1,}[ "]{1,}\S{1,}[ "]{1,}[t]{1}[i]{1}[t]{1}[l]{1}[e]{1}[ ]{0,}[=]{1,}[ "]{1,}[V]{1}[i]{1}[e]{1}[w]{1}/g);
num = x[0].match(/\d{1,}/g)[0];
userURL = "https://forums.taleworlds.com/index.php?action=profile;u=" + num;
wmURL = "https://web.archive.org/web/0/" + userURL;
lnk.style.display = "block";
lnk.style.padding = "5px";
lnk.href = wmURL;
lnk.innerText = "Click!";
lnk.target = "_blank";
}
};
xhttp.send();
});
ns = document.body.getElementsByClassName("navigate_section")[0];
exBtn = document.createElement("button");
ns.appendChild(exBtn);
exBtn.innerText= "Get former name";
ssURL = document.head.getElementsByTagName("link")[0].href.match(/\w{1,}/g);
srcTxtr = "url('" + ssURL[0] + "://" + ssURL[1] + "." + ssURL[2] + "." + ssURL[3] + "/" + ssURL[4] + "/" + ssURL[5] + "/" + "images/button_a.jpg" + "')";
lnk = document.createElement("a");
lnk.href = "#";
lnk.innerText="#";
ns.appendChild(lnk);
lnk.style.display = "none";
exBtn.style.backgroundImage = srcTxtr;
exBtn.addEventListener("click",function(){
userURL = window.location.href;
wmURL = "https://web.archive.org/web/0/" + userURL;
lnk.style.display = "block";
lnk.style.padding = "5px";
lnk.href = wmURL;
lnk.innerText = "Click!";
lnk.target = "_blank";
});
// ==UserScript==
// @name blogs
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://forums.taleworlds.com/index.php/board,253*
// @include https://www.taleworlds.com/en/Shared/AllNewsPartial?section=6&pageIndex=1&pageSize=1000*
// @include https://forums.taleworlds.com/index.php?*
// @grant none
// ==/UserScript==
var curWindow = window.location.href;
var segs = "x.y";
let threadLinkStrings = [];
let usableThreadLinks = [];
let entryTitlesDesc = [];
let entryTitlesAsc = [];
if(curWindow !== null && curWindow !== undefined && curWindow !== ""){
var segs = curWindow.match(/\w{1,}/g);
}
if (window.innerWidth > 2 && window.innerHeight > 2) {
let threadLinks = document.getElementsByTagName("a");
for(let j=0;j<threadLinks.length;j++){
if(threadLinks[j].innerText.match(/Dev Blog/g) && threadLinks[j].href.match(/topic/g) && threadLinks[j].href.match(/[.]{1}0[.]{1}/g) && !threadLinks[j].href.match(/msg/g)){
usableThreadLinks[usableThreadLinks.length] = threadLinks[j];
let parentEl = threadLinks[j].parentElement;
let smallBtn = document.createElement("button");
smallBtn.innerText = "More";
smallBtn.style.background = "url('https://forums.taleworlds.com/Themes/TWcurve/images/theme/menu_gfx.png')";
smallBtn.addEventListener("click", function(event){
event.preventDefault();
});
smallBtn.addEventListener("click", function(event){
let parent = event.target.parentElement;
let aElement = parent.getElementsByTagName("a")[0];
var xhttp = new XMLHttpRequest();
xhttp.open("GET", aElement.href, true);
xhttp.send();
setTimeout(function(){
if(!aElement.innerText.match(/ - Blog /g)){
let firstPage = xhttp.responseText;
let blogPic = firstPage.match(/blog_post/g)[0];
let entryNo = parseInt(firstPage.match(/blog_post_\d{1,}_taleworldswebsite/g)[0].match(/\d{1,}/g)[0])+16;
let miniFrame = document.createElement("iframe"); // because sending requests didn't work
miniFrame.id = "mini";
miniFrame.width=2;
miniFrame.height=2;
miniFrame.src = "https://forums.taleworlds.com/index.php?no="+entryNo;
document.body.appendChild(miniFrame);
let txt = aElement.innerText;
aElement.innerText = txt + " - Blog " + entryNo;
setTimeout(function(){
let mf = document.getElementById("mini");
txt = aElement.innerText;
let cleanTitle = decodeURI(mf.src.substring(40));
aElement.innerText = txt + ": " + cleanTitle;
mf.remove();
},6000);
}
},600); // give enough time for the site to load
});
parentEl.appendChild(smallBtn);
}
}
}
else if (segs[1] == "forums" && location.href.match(/[?]{1}no[=]{1}/g)){
location.assign("https://www.taleworlds.com/en/Shared/AllNewsPartial?section=6&pageIndex=1&pageSize=1000&"+ segs[7] );
setTimeout(function(){
},10000);
}
else if(segs[1]=="www"){
let lnks=document.getElementsByTagName("a");
for(let i=0;i<lnks.length;i++){
let lnkTitle = lnks[i].innerText;
if(lnkTitle != "Mount & Blade II: Bannerlord at E3 2017 – Reactions"
&& lnkTitle != "Mount & Blade II: Bannerlord - Battles and Combat Detailed at E3"
&& lnkTitle != "Mount & Blade II: Bannerlord at E3 2017 – Where to Watch"
&& lnkTitle != "Mount & Blade II: Bannerlord Playable At E3 2017"
&& lnkTitle != "Mount & Blade II: Bannerlord Featured on PC Gamer Magazine Cover!"
&& lnkTitle != "Mount & Blade II: Bannerlord on Steam"
&& lnkTitle != "Mount & Blade II: Bannerlord @ Gamescom 2016"
&& lnkTitle != "Bannerlord Sieges Revealed at E3"
&& lnkTitle != "Mount & Blade II: Bannerlord at E3 2016"
&& lnkTitle != "Rock, Paper, Shotgun Interview!"
&& lnkTitle != "40 minutes of gameplay at PC Gamer Weekender"
&& lnkTitle != "Mount & Blade II: Bannerlord – First glimpse"
&& lnkTitle != "Mount & Blade II: Bannerlord at E3 2016"
&& lnkTitle != "Mount&Blade II: Bannerlord Announcement!"){
entryTitlesDesc[entryTitlesDesc.length] = lnkTitle;
}
}
entryTitlesAsc = entryTitlesDesc.reverse();
location.replace("https://forums.taleworlds.com/index.php?" + entryTitlesAsc[segs[13]-1]);
}
else if (segs[1] == "forums" && !location.href.match(/[?]{1}no[=]{1}/g)){
let frm = window.frameElement;
if(frm.src != location.href){
frm.src = location.href;
}
}