はてなコピィで途中で保存できるようにした
by
mafucode
2014-05-03 [2014/05/03 05:46:13]
B!と書いてあるボタンだけにはてなブックマークに保存する。あと、続きから作業するのは後でうpするかもしれない
-
/*
* @title はてなコピィで途中で保存できるようにした
* @description B!と書いてあるボタンだけにはてなブックマークに保存する。あと、続きから作業するのは後でうpするかもしれない
* @include http://copie.hatelabo.jp/*
* @license 未定
*/
setTimeout((function(){
if(location.href.match(/http\:\/\/copie\.hatelabo\.jp\/[\w\-\_]+\/banner\.create/)!=null){
return null;
}
var bf;
bf=document.createElement('input');
bf.setAttribute('type','button');
bf.setAttribute('value','B!');
bf.setAttribute('title','はてなブックマークに保存');
bf.addEventListener('click',(function(e){
console.log(e);
var qs1,qs2,i;
qs2=new Array();
i=0;
qs1=document.querySelectorAll('#form div.main p img.previewImage')[0].src.split('?')[1].split("&");
while(i<qs1.length){
switch (qs1[i].split('=')[0]){
case "cache":
case "":
case "rkm":
break;
default:
qs2.push(qs1[i]);
break;
}i+=1;
}
window.open('http://b.hatena.ne.jp/mafucode/add.confirm?url='+encodeURIComponent(document.querySelectorAll('#form div.main p img.previewImage')[0].src.split('?')[0]+'?'+qs2.join('&')))
}),false);
document.querySelectorAll('#form div.main p.advanced')[0].appendChild(bf);
}),3500);
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。