Skip to content

Instantly share code, notes, and snippets.

@NKid
Created April 13, 2013 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NKid/6ef8c64427d0ce4e30f2 to your computer and use it in GitHub Desktop.
Save NKid/6ef8c64427d0ce4e30f2 to your computer and use it in GitHub Desktop.
M01 Hightlight Today
// ==UserScript==
// @name M01 Hightlight Today
// @description M01 Hightlight Today
// @include http://www.mobile01.com/topiclist.php*
// @include http://www.mobile01.com/forumtopic.php*
// @include http://www.mobile01.com/newtopics.php*
// @include http://www.mobile01.com/hottopics.php*
// ==/UserScript==
function padLeft(nr, n, str) {
return Array(n - String(nr).length + 1).join(str || '0') + nr;
}
var today=new Date();
var tstr=today.getFullYear()+ "-" + padLeft(today.getMonth()+1,2) + "-" + padLeft(today.getDate(),2);
console.log(tstr);
var t=document.querySelectorAll('td.authur a p:nth-child(1)');
for(var i=0;i<t.length;i++)
{
if(t[i].innerHTML.indexOf(tstr) != -1)
t[i].style.backgroundColor='yellow';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment