Skip to content

Instantly share code, notes, and snippets.

@kageroh
Created February 1, 2012 11:09
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 kageroh/1716580 to your computer and use it in GitHub Desktop.
Save kageroh/1716580 to your computer and use it in GitHub Desktop.
しょぼかる通知プラグイン
(function(global) {
var nowline = document.getElementById('nowline');
setInterval(function() {
var items = document.querySelectorAll('td.v3dayCell:last-child div.pid-item');
for (var i = items.length; i--;) {
var item = items[i];
var itemTop = parseFloat(item.style.top);
var itemBottom = parseFloat(item.style.height) + itemTop;
var nowlineTop = parseFloat(nowline.style.top);
if (itemTop <= nowlineTop &&
nowlineTop <= itemBottom &&
!item.alerted) {
item.alerted = true;
var title = item.querySelector('a.v3title').textContent;
alert(title);
break;
}
}
}, 60000);
}(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment