Created
August 3, 2012 15:52
-
-
Save regtan/3248917 to your computer and use it in GitHub Desktop.
mixiのvoiceの未読件数をタイトルバーに表示するuserscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name mixivoicecounter | |
// @namespace regtan | |
// @description for mixi voice | |
// @include http://mixi.jp/* | |
// ==/UserScript== | |
function voice_counter(){ | |
var newFeed = document.getElementsByClassName("newFeed")[0]; | |
if(newFeed != null){ | |
var p = newFeed.getElementsByTagName("p")[0]; | |
if (p != null){ | |
var a = p.getElementsByTagName("a")[0]; | |
if(a != null){ | |
var message = a.text; | |
document.title = "[mixi] (" + message.match(/友人の新しい発言が(.*)件あります。/)[1] + ")"; | |
} | |
} | |
}else{ | |
document.title = "[mixi]"; | |
} | |
} | |
setInterval(voice_counter,1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment