2009-12-28
アニメ!アニメ!のエントリータイトルをtitleタグに追加するグリモン書いた
発端は「アニメ!アニメ!がブクマされにくいのは何でかね」問題 - そっと××から。
(そもそもmovabletypeつかってるんなら<mt:EntryTitle />をtitleタグのところに入れりゃ済む話なんで、そういう啓蒙をするのが先だったりする)
普段ならcho45の$X関数をコピペする事例だけど、はしょってstringValueで。
// ==UserScript== // @name animeanime.jp: replace title with entrytitle // @namespace http://www.otsune.com/ // @description replace title with entrytitle // @include http://animeanime.jp/* // ==/UserScript== (function() { //var xpath = 'id("blog")/div[@class="blog_box"]/div[@class="b_tit"]/a'; var xpath = '//div[@class="b_tit"]/a'; var entryname = document.evaluate(xpath, document, null, XPathResult.STRING_TYPE, null).stringValue; if(entryname.length) { document.title = entryname + ' - ' + document.title; } })();
http://svn.coderepos.org/share/lang/javascript/userscripts/animeanime_replace_title.user.js
ついでにuse.Perlのjournalもtitle追加するグリモン書いた。
こういうのはWedataでXPathを共有してgistとかでも使えるようにするってのがいいかもなぁ。
// ==UserScript== // @name use Perl Journal: Add title with journal title // @namespace http://www.otsune.com/ // @include http://use.perl.org/~*/journal/* // ==/UserScript== (function() { var xpath = 'id("journalslashdot")/div[@class="title"]/h3'; var journaltitle = document.evaluate(xpath, document, null, XPathResult.STRING_TYPE, null).stringValue; if(journaltitle.length) { document.title = journaltitle + ' - ' + document.title; } })();
http://svn.coderepos.org/share/lang/javascript/userscripts/use_perl_journal_add_tit.user.js
トラックバック - http://subtech.g.hatena.ne.jp/otsune/20091228

http://wedata.net/databases/AutoTitle/items
http://userscripts.org/scripts/show/25800