pixivの検索結果にはてブ

    @@ -1,14 +1,30 @@ /* - * @title bookmarklet - * @description my bookmarklet - * @include http://* + * @title pixivの検索結果にはてブ + * @description なんかスクロールバーがたまに無意味(←うるさい) + * @include htt*://www.pixiv.net* * @license MIT License * @require */ -document.querySelectorAll('li.image-item')[0].innerHTML+='<a href="' -+location.protocol+'//'+location.hostname+document.querySelectorAll('li.image-item a.work')[0].attributes['href'].value -+'" class="hatena-bookmark-button" data-hatena-bookmark-title="' -+document.querySelectorAll('li.image-item h1.title')[0].attributes['title'].value -+'" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>' - +i = 0; +if ((location.protocol == 'http:') + && (location.hostname == 'www.pixiv.net') + && (location.pathname == '/search.php')) { + while (document.querySelectorAll('li.image-item ul').length > i) { + if (!document.querySelectorAll('li.image-item')[i] + .querySelector('ul.count-list')) { + document.querySelectorAll('li.image-item')[i].innerHTML += '<ul class="count-list">'; + } + document.querySelectorAll('li.image-item ul')[i].innerHTML += '<a href="http://b.hatena.ne.jp/add?mode=confirm&url=' + + escape(location.protocol + + '//' + + location.hostname + + document.querySelectorAll('li.image-item a.work')[i].attributes['href'].value) + // + '" class="hatena-bookmark-button" + // data-hatena-bookmark-title="' + // + document.querySelectorAll('li.image-item + // h1.title')[i].attributes['title'].value + + '" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a>'; + i += 1; + } +}
  • /*
     * @title pixivの検索結果にはてブ
     * @description なんかスクロールバーがたまに無意味(←うるさい)
     * @include htt*://www.pixiv.net*
     * @license MIT License
     * @require 
     */
    
    i = 0;
    if ((location.protocol == 'http:') 
    		&& (location.hostname == 'www.pixiv.net')
    		&& (location.pathname == '/search.php')) {
    	while (document.querySelectorAll('li.image-item ul').length > i) {
    		if (!document.querySelectorAll('li.image-item')[i]
    				.querySelector('ul.count-list')) {
    			document.querySelectorAll('li.image-item')[i].innerHTML += '<ul class="count-list">';
    		}
    		document.querySelectorAll('li.image-item ul')[i].innerHTML += '<a href="http://b.hatena.ne.jp/add?mode=confirm&url='
    				+ escape(location.protocol
    						+ '//'
    						+ location.hostname
    						+ document.querySelectorAll('li.image-item a.work')[i].attributes['href'].value)
    				// + '" class="hatena-bookmark-button"
    				// data-hatena-bookmark-title="'
    				// + document.querySelectorAll('li.image-item
    				// h1.title')[i].attributes['title'].value
    				+ '" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a>';
    		i += 1;
    	}
    }
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/03/22 17:53:23 - 2013-03-22
  2. 2013/03/22 17:48:35 - 2013-03-22
  3. 2013/03/21 20:10:28 - 2013-03-21