Porta-catalog user javascript. Shows the most recently active boards in qresearch.
function navigate() { var target = document.getElementById('dythreads'); if (target && typeof target.value != 'undefined') { window.location.href=target.value; }}function browse(url) { var response; var x = new XMLHttpRequest(); x.open('GET', url, true); x.onreadystatechange = function() { if(x.readyState = 4 && x.status 200) { response = JSON.parse(x.responseText); var target = document.getElementById('dythreads'); var bread = response.posts[0]; var opt = document.createElement('OPTION'); target.appendChild(opt); var txt = bread.sub; if (typeof txt == 'undefined') { txt = bread.com; if (txt.length 40) { txt = txt.substring(0,39) + '...'; } } opt.innerHTML=bread.no + ' - ' + txt; opt.value="/qresearch/res/" + bread.no + ".html"; } }; x.send();}function refresh() { var url = "https://8ch.net/qresearch/threads.json"; var target = document.getElementById('dythreads'); if (target) target.options.length=0; var response; var x = new XMLHttpRequest(); var thread; x.open('GET', url, true); x.onreadystatechange = function() { if(x.readyState = 4 && x.status 200) { response = JSON.parse(x.responseText); process_threads(response); } }; x.send(); }function process_threads(board) { var now = ~~((new Date).getTime() / 1000); for(var i = 0; i < board.length; i++) { for(var j = 0; j < board[i].threads.length; j++) { thread = board[i].threads[j]; // only show threads modified within the last 30 minutes if (now - thread.last_modified < 1800) { browse('https://8ch.net/qresearch/res/'+thread.no + '.json'); } } }} var target = document.getElementsByName('postcontrols')[0]; var div = document.createElement('DIV');div.id='target';if (target) {target.appendChild(div);div.style = 'z-index:10;' + 'top:20px;' + 'left:10;padding:1px 3px 0 3px;' + 'position:fixed;height:20px;width:406px;' + 'display:block;' + 'background-color:white;border:1px solid black;' + 'border-radius:3px;'; var threads = document.createElement('SELECT');div.appendChild(threads);threads.id='dythreads'; threads.onchange=function() { navigate();};setInterval("refresh();", 60000);refresh(); }