« Movable Type と TypePad のテンプレートタグを比較してみる | トップページ | japan.internet.com の記事に「ECナビ人気ニュース」へブックマークするリンクが付いた »
2006.06.08
複数のソーシャルブックマークサービスに同時に投稿するスクリプト
「右クリックではてなブックマーク、ついでにdel.icio.us」、「右クリックで MM/Memo」、「右クリックでBlogPeople Tags」、「右クリックでECナビ人気ニュース」、「右クリックでニフティクリップ」、などなど、ソーシャルブックマークサービスが増えるにつれて、MenuExt スクリプトも増える一方なのですが、思い切って、1個のスクリプトにまとめてみました。
単に1個にまとめただけではなく、今までの「右クリック」シリーズでは対応していなかったサイトにも対応してみています。ソーシャルブックマーク系だけではなく、ソーシャルニュース系にも対応しつつ、クリップした Webページの情報を Gmail で送信する(右クリックで Gmail It!)機能も統合してみました。
クリップしたいWebページ閲覧中に、右クリックで本スクリプトを起動すると、以下のようなダイアログが開きます。
(上の画像をクリックすると、さらに大きな画像を表示します)
最大19箇所同時に投稿できる
投稿先を選択して(複数選択可能)、「実行」ボタンを押せば、指定した投稿先に順番に投稿していきます。 このスクリプトは IE 専用ですが、たぶん、他のブラウザで動かすのもそんなに難しくはないと思います。
ちなみに、本スクリプトが対応しているサービスは、以下の通りです。
- はてなブックマーク
- del.icio.us
- MM/Memo
- BlogPeople Tags
- ドリコムRSS
- JoltMark
- Flog
- ECナビ人気ニュース
- ニフティクリップ
- ROOTACE
- Google Bookmark
- Gmail
- Markezine
- CoRich
- BlogHeader SBM
- baqoo
- digg
- Excite リンクポスト
なお、上記サービス全てを利用していないと本スクリプトは使えない、なんてことはありません。どれか1つだけも使っていれば、本スクリプトを利用することができます。
注意して欲しいのは、ソーシャルニュース系(上記でいえば、reddit、digg、Excite リンクポスト)へ投稿するときは、まだ誰も投稿していない URL であるか事前に確認してから投稿しましょう、ということ。
Should you encounter a potential duplicate, please digg the original story and do not submit a duplicate entry.
digg: FAQ
すでに誰かによって投稿(登録)済みの URL を二重に投稿するのは嫌がられます(例えば、digg の場合は、二重投稿するなという注意書きがあちこちに存在します)。
それではソースです。(最終更新: 2006年6月9日)
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript" src="md5.js"></script>
<script language="JavaScript" type="text/javascript">
/* 右クリックで各所にブックマーク */
/* 指定した複数のソーシャルブックマークに同時登録できます */
/* 注意: 本スクリプトを使用するにあたって、あらかじめ */
/* Paj’s Home: Cryptography: JavaScript MD5 */
/* (http://pajhome.org.uk/crypt/md5/index.html) */
/* にて公開されている */
/* md5.js */
/* (ソース本体: http://pajhome.org.uk/crypt/md5/md5.js) */
/* (ソースリスト: http://pajhome.org.uk/crypt/md5/md5src.html) */
/* をダウンロードして、本スクリプトと同じディレクトリ(フォルダ) */
/* に設置しておいてください。 */
/* */
/* また、Internet Explorer 6.0 SP2 以降をお使いの場合は、セキュリ */
/* ティの警告が出ることがあります。警告が出るたびに「コンテンツの */
/* 実行を許可」してください。毎回「許可」するのが面倒だと思う方は、 */
/* Internet Explorer の */
/* ツール - インターネットオプション - 詳細設定 */
/* の「マイ コンピュータのファイルでのアクティブ コンテンツの実行 */
/* を許可する」をチェック状態にしてください。ただし、この設定変更 */
/* によりセキュリティ上の危険性が高まりますので、ご注意ください。 */
/* */
/* written by H.Tsujimura (tsupo) 2006 */
/* 関連情報提供場所: http://watcher.moe-nifty.com/ */
/* */
/* Ver 1.1 2006/06/09 登録対象選択ダイアログでのタイトル、URL、コメントの編 */
/* 集結果を投稿内容に反映するようにした */
/* Ver 1.0 2006/06/08 最初の版 */
obj = external.menuArguments; // 右クリック時の引数のオブジェクトの参照
page_url = obj.document.URL; // ページのURL
title_txt = obj.document.title; // タイトル文字列
cite_txt = obj.document.selection.createRange().text; // 引用文字列
// ↓↓ あなたのアカウントに変更して、お使いください
del_userID = "tsupo"; // del.icio.us のアカウント
// ↑↑ あなたのアカウントに変更して、お使いください
if ( obj.location.href && (obj.location.href != "") )
page_url = obj.location.href; // 「はてなダイアリーキーワード」対策
if ( title_txt == "[object]" ) {
str = obj.document.body.parentNode;
inn = str.innerHTML;
s = inn.indexOf("<TITLE>");
e = inn.indexOf("</TITLE>");
if ( (s > 0) && (e > s) )
title_txt = inn.substring(s + 7, e);
}
function escapeString(str) {
result = "";
len = str.length;
for ( i = 0; i < len; i++ ) {
if ( str.charAt(i) == '?' )
result += "%3F";
else if ( str.charAt(i) == '>' )
result += "%3E";
else if ( str.charAt(i) == '=' )
result += "%3D";
else if ( str.charAt(i) == '<' )
result += "%3C";
else if ( str.charAt(i) == ':' )
result += "%3A";
else if ( str.charAt(i) == '/' )
result += "%2F";
else if ( str.charAt(i) == '&' )
result += "%26";
else if ( str.charAt(i) == '%' )
result += "%25";
else if ( str.charAt(i) == '#' )
result += "%23";
// else if ( str.charAt(i) == ' ' )
// result += "%20";
else if ( str.charAt(i) == '\n' )
result += escape("\n");
else
result += str.charAt(i);
}
return ( result );
}
function hatenaIdAutoDiscovery()
{
var ret = false;
// まず、head 部分から探索
var str = obj.document.body.parentNode;
var inn = str.innerHTML;
var idx1 = inn.indexOf("foaf:OnlineAccount");
if ( idx1 == -1 ) {
// head 部分に存在しない場合は body 部分を探索
str = obj.document.body;
inn = str.innerHTML;
idx1 = inn.indexOf("foaf:OnlineAccount");
}
if ( idx1 > 0 ) {
if ( inn.indexOf('<foaf:accountServiceHomepage rdf:resource="http://www.hatena.ne.jp/" />') > 0 ) {
idx2 = inn.indexOf('foaf:accountName="');
if ( idx2 > 0 ) {
hatenaIdForTipsjar = inn.substring(idx2+18,inn.indexOf('</foaf:OnlineAccount>'));
hatenaIdForTipsjar = hatenaIdForTipsjar.substring(0, hatenaIdForTipsjar.indexOf('"'));
ret = true;
}
}
}
return ( ret );
}
function postHatenaBookmark( title_txt, page_url, cite_txt )
{
if ( cite_txt != "" ) {
// はてなID auto-discovery (投げ銭可能かどうかチェック)
isTipsjarOK = hatenaIdAutoDiscovery();
asin = "";
if ( page_url.match("/asin/") || page_url.match("/ASIN/") || page_url.match("/gp/product/") ) {
asinIdx = page_url.indexOf("/asin/");
if ( asinIdx < 0 )
asinIdx = page_url.indexOf("/ASIN/");
if ( asinIdx < 0 )
asinIdx = page_url.indexOf("/gp/product/") + 6;
if ( asinIdx >= 0 ) {
asinIdx += 6;
len = page_url.length;
if ( len >= asinIdx + 11 )
len = asinIdx + 11;
asin = page_url.substring(asinIdx,len);
if ( asin.charAt(asin.length - 1) == '/' )
asin = asin.substring(0,asin.length - 1);
}
}
newWin = window.open('http://b.hatena.ne.jp/add?mode=confirm&is_bm=1&title='+escape(title_txt)+'&url='+escape(page_url)+'&comment='+escape(cite_txt), '_blank', 'width=520,height=600,resizable=1,scrollbars=1');
t = newWin.document.cookie;
loc = t.lastIndexOf(';');
if ( loc > 0 )
rk = t.substring(0,t.lastIndexOf(';'));
else
rk = t;
rk = rk.substring(rk.lastIndexOf('=')+1);
rkm = b64_md5(rk);
newWin.document.open();
newWin.document.write("<html>\n<head>\n<title>はてなブックマーク - ソーシャルブックマーク</title>\n");
newWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n');
newWin.document.write('<meta http-equiv="Content-Style-Type" content="text/css">\n');
newWin.document.write('<meta http-equiv="Content-Script-Type" content="text/javascript">\n');
newWin.document.write('<sc' + 'ript type="text/javascript" src="http://b.hatena.ne.jp/js/comment_counter.js"></sc' + 'ript>\n');
newWin.document.write('<link rel="stylesheet" type="text/css" href="http://b.hatena.ne.jp/style">\n');
newWin.document.write('<style type="text/css">\n#body {\n margin-left: 0px;\n}\n\n.info td {\n font-size: 80%;\n}\n\n');
newWin.document.write('div.note {\n margin-left: 10px;\n margin-top: 20px;\n}\n\n');
newWin.document.write('div.info p {\n font-size: 90%;\n}\n\ndiv.info p.addurl-footer {\n font-size: 100%;\n}\n');
newWin.document.write('</style>\n');
newWin.document.write('</head>\n<body>\n');
newWin.document.write('<div id="banner"><h1><a href="http://www.hatena.ne.jp/" target="_blank"><img src="http://b.hatena.ne.jp/images/hatena_de.gif" width="104" height="40" alt="Hatena"></a>');
newWin.document.write('<a href="http://b.hatena.ne.jp/" target="_blank"><img src="http://b.hatena.ne.jp/images/Bookmarkde.gif" width="118" height="40" alt="Bookmark"></a>');
newWin.document.write('<img src="http://b.hatena.ne.jp/images/betade.gif" width="42" height="40" alt="beta" title="beta">');
newWin.document.write('<img border="0" src="http://b.hatena.ne.jp/images/tri_de.gif" width="15" height="40" usemap="#trimap" alt="tri"></h1>');
newWin.document.write('<a href="http://www.hatena.ne.jp/"><img src="http://b.hatena.ne.jp/images/hatenade.gif" class="logo" alt="はてな" title="はてな"></a></div>\n');
newWin.document.write('<map name="trimap">\n');
newWin.document.write('<area shape="rect" coords="1,10,15,25" href="http://a.hatena.ne.jp/" alt="はてなアンテナ" title="はてなアンテナ">\n');
newWin.document.write('<area shape="rect" coords="1,25,15,40" href="http://d.hatena.ne.jp/" alt="はてなダイアリー" title="はてなダイアリー">\n');
newWin.document.write('</map>\n');
newWin.document.write('<div id="container">\n');
newWin.document.write('<div id="body">\n');
newWin.document.write('<h2>ブックマークの確認</h2>\n');
newWin.document.write('<form action="http://b.hatena.ne.jp/add" method="POST" name="add" id="edit_form" style="margin:0">\n');
newWin.document.write('<input type="hidden" name="mode" value="enter">\n');
newWin.document.write('<input type="hidden" name="eid" value="">\n');
newWin.document.write('<input type="hidden" name="url" value="' + page_url + '">\n');
newWin.document.write('<input type="hidden" name="rkm" value="' + rkm + '">\n');
newWin.document.write('<input type="hidden" name="is_bm" value="1">\n');
newWin.document.write('<div class="info">\n<table>\n<tr>\n');
newWin.document.write('<td class="label" nowrap>URL</td>\n<td class="addurl">\n');
newWin.document.write('<a href="' + page_url + '" target="_blank">' + page_url + '</a>\n');
newWin.document.write('</td>\n</tr><tr>\n<td class="label" nowrap>タイトル</td>\n<td>\n');
newWin.document.write('<input type="text" name="title" value="' + title_txt + '" size="50" />\n');
newWin.document.write('</td>\n</tr>\n<tr>\n<td class="label" nowrap>コメント<br><span class="note">(省略可)</span></td>\n<td>\n');
newWin.document.write('<input type="text" name="comment" id="comment" value="' + cite_txt + '" size="50" onKeyUp="countBytes()" />\n');
newWin.document.write('<span id="comment_count"></span>\n<div id="candidates_list"></div>\n</td>\n</table>\n');
newWin.document.write('</div>\n');
if ( isTipsjarOK ) {
newWin.document.write('<!-- ポイント送信 -->\n');
newWin.document.write('<input type="hidden" name="hatenaid" value="' + hatenaIdForTipsjar + '">\n');
newWin.document.write('<p><input type="checkbox" name="tipjar" value="1" id="tipjar"> <label for="tipjar">このエントリーの作者にポイントを送信する</label></p>\n');
}
else if ( asin != "" ) {
newWin.document.write('<input type="hidden" name="asin" value="' + asin + '">\n');
newWin.document.write('<p><input type="checkbox" name="addasin" value="1" checked="checked">この商品をコレクションに加える</p>\n');
}
newWin.document.write('<input type="submit" name="commit" value="追加する">\n');
newWin.document.write('<input type="submit" name="go_bm" value="追加して確認">\n');
newWin.document.write('<div id="tags_list"></div>\n<div id="othertags_list"></div>\n<div id="keywords_list"></div>\n');
newWin.document.write('</form>\n');
newWin.document.write('<div class="note" style="padding-bottom: 1em;">※コメント欄で"[hoge]..."と書くとタグが利用できます。→<a href="/help#tag" target="_blank">詳しい説明</a></div>\n');
newWin.document.write('</div>\n</div>\n');
newWin.document.write('</body>\n</html>\n');
newWin.document.close();
newWin.document.focus();
}
else
window.open('http://b.hatena.ne.jp/add?mode=confirm&is_bm=1&title='+escape(title_txt)+'&url='+escape(page_url), '_blank', 'width=520,height=600,resizable=1,scrollbars=1');
}
function postDelicious( title_txt, page_url, cite_txt )
{
if ( cite_txt != "" )
window.open('http://del.icio.us/' + del_userID + '?v=2&url=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt) + '&extended=' + encodeURIComponent(cite_txt));
else
window.open('http://del.icio.us/' + del_userID + '?v=2&url=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt));
}
function postMMmemo( title_txt, page_url, cite_txt )
{
if ( cite_txt != "" )
window.open('http://1470.net/mm/memo_form.html?url=' + encodeURIComponent(page_url) + '&memo_title=' + encodeURIComponent(title_txt) + '&memo_text=' + encodeURIComponent(cite_txt));
else
window.open('http://1470.net/mm/memo_form.html?url=' + encodeURIComponent(page_url) + '&memo_title=' + encodeURIComponent(title_txt));
}
function postBlogPeopleTags( title_txt, page_url, cite_txt )
{
if ( cite_txt != "" )
window.open('http://tags.blogpeople.net/tags_addlink.jsp?u=' + encodeURIComponent(page_url) + '&ti=' + escape(title_txt) + '&de=' + escape(cite_txt));
else
window.open('http://tags.blogpeople.net/tags_addlink.jsp?u=' + encodeURIComponent(page_url) + '&ti=' + escape(title_txt));
}
function postDrecomRSS( title_txt, page_url, cite_txt )
{
if (cite_txt == '') {
t = title_txt;
window.open('http://rss.drecom.jp/shortcut/add_clip?url='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt)+'&comment='+encodeURIComponent(t),
'add_clip',
'scrollbars=yes,width=450,height=500,left=100,top=100,status=yes,resizable=yes');
}
else {
t = cite_txt;
newWin = window.open('http://rss.drecom.jp/shortcut/add_clip?url='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt)+'&comment='+encodeURIComponent(t),
'add_clip',
'scrollbars=yes,width=450,height=500,left=100,top=100,status=yes,resizable=yes');
newWin.document.open();
newWin.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n');
newWin.document.write('<html lang="ja">\n<head>\n');
newWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n');
newWin.document.write('<meta http-equiv="Content-Style-Type" content="text/css">\n');
newWin.document.write('<meta http-equiv="Content-Script-Type" content="text/javascript">\n');
newWin.document.write('<title>クリップ追加 - ドリコムRSS</title>\n');
newWin.document.write('<link rel="stylesheet" href="http://rss.drecom.jp/css/default.css" type="text/css" />\n');
newWin.document.write('<link rel="shortcut icon" href="http://rss.drecom.jp/favicon.ico" />\n');
newWin.document.write('<link rel="alternate" type="application/rss+xml" title="RSS" href="http://rss-help.cms.drecom.jp/topics_0_1_0.rdf" />\n');
newWin.document.write('<link href="/css/home.css" rel="stylesheet" type="text/css">\n</head>\n');
newWin.document.write('<body onLoad="window.focus()">\n');
newWin.document.write('<div class="window_form">\n<div class="window_header">クリップの追加</div>\n');
newWin.document.write('<form action="http://rss.drecom.jp/shortcut/add_clip_done" method="post">\n');
newWin.document.write('<div class="bookmarklet_message_error">\n</div>\n');
newWin.document.write('<div class="window_text_1">タイトル</div>\n<div class="window_text">\n');
newWin.document.write('<input type="text" name="clip_title" id="clip_title" value="' + title_txt + '">\n');
newWin.document.write('</div>\n<div class="bookmarklet_message_error">\n</div>\n');
newWin.document.write('<div class="window_text_1">URL</div>\n<div class="window_text">\n');
newWin.document.write('<input type="text" name="clip_url" id="clip_url" value="' + page_url + '">\n');
newWin.document.write('</div>\n<div class="bookmarklet_message_error">\n</div>\n');
newWin.document.write('<div class="window_text_1">登録先フォルダ</div>\n<div class="window_text">\n');
newWin.document.write('<select name="clip_folder">\n');
newWin.document.write('<option value="1">IT</option>\n');
newWin.document.write('<option value="2">エンターテイメント</option>\n');
newWin.document.write('<option value="3">サイエンス</option>\n');
newWin.document.write('<option value="4">地域</option>\n');
newWin.document.write('<option value="5">社会</option>\n');
newWin.document.write('<option value="6">コラム</option>\n');
newWin.document.write('<option value="7">訃報</option>\n');
newWin.document.write('<option value="8">文化・芸能</option>\n');
newWin.document.write('<option value="9">blog</option>\n');
newWin.document.write('<option value="10">経済・経営</option>\n');
newWin.document.write('<option value="11">政治</option>\n');
newWin.document.write('<option value="12">スポーツ</option>\n');
newWin.document.write('<option value="13">ブックレビュー</option>\n');
newWin.document.write('<option value="14">国際</option>\n');
newWin.document.write('<option value="15">テクノロジー</option>\n');
newWin.document.write('</select>\n</div>\n<div class="window_text_1">コメント</div>\n<div class="window_text">\n');
newWin.document.write('<textarea name="clip_comment" rows="8">' + t + '</textarea>\n');
newWin.document.write('</div>\n<div id="submit">\n');
newWin.document.write('<input type="submit" value="登録">\n');
newWin.document.write('</div>\n</form>\n<div id="submit">\n<p>\n');
newWin.document.write('<input type="button" value="閉じる" onclick="window.close(); return false;">\n');
newWin.document.write('</p>\n</div>\n</div>\n</body>\n</html>\n');
newWin.document.close();
newWin.document.focus();
}
}
function postJoltMark( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://mark.jolt.jp/mark/entryMark.do?u=' + encodeURIComponent(page_url) + '&t=' + encodeURIComponent(title_txt));
}
function postFlog( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://www.flog.jp/post.php?url_uri=' + encodeURIComponent(page_url) + '&url_title=' + encodeURIComponent(title_txt));
}
function postECnavi( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://news.ecnavi.jp/config/add/confirm?url='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt)+'&encoded='+encodeURIComponent('ECナビ'));
}
function postNiftyClip( title_txt, page_url, cite_txt )
{
if ( cite_txt != "" )
window.open('http://clip.nifty.com/create?url=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt) + '&comment=' + encodeURIComponent(cite_txt));
else
window.open('http://clip.nifty.com/create?url='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt));
}
function postRootace( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://www.rootace.com/add.php?title='+escape(title_txt)+'&url='+escape(page_url)+'&v=1','_blank','width=480,height=490,resizable=1,scrollbars=1');
}
function postGoogleBookmark( title_txt, page_url, cite_txt )
{
if ( cite_txt != "" )
window.open('http://www.google.com/bookmarks/mark?op=add&bkmk=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt) + '&annotation=' + encodeURIComponent(cite_txt) + '&hl=ja');
else
window.open('http://www.google.com/bookmarks/mark?op=add&bkmk=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt) + '&hl=ja');
}
function postGmail( title_txt, page_url, cite_txt )
{
page_title = escapeString( title_txt );
page_url = escapeString( page_url );
d = 'http://mail.google.com/mail/?view=cm&tf=1&cmid=2&init=1&fs=1';
d += '&su=' + page_title + '&body=URL%3A ' + page_url;
if ( cite_txt ) {
page_body = escapeString( cite_txt );
d += escape('\n') + '内容%3A ' + page_body;
}
window.open(d,'gmail','toolbar=no,width=600,height=600');
}
function postMarkezine( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://markezine.jp/bookmark/?mode=new&style=simple&u='+escape(page_url)+'&t='+escape(title_txt), '_blank', 'width=550,height=700,resizable=1,scrollbars=1');
}
function postCoRich( title_txt, page_url, cite_txt )
{
// 注意: title_txt, cite_txt の値は無視されます
window.open('http://newsclip.corich.jp/clip/public_html/marklet.php?url='+escape(page_url));
}
function postBlogHeader( title_txt, page_url, cite_txt )
{
// 注意: title_txt, cite_txt の値は無視されます
window.open('http://sbm.blogheader.com/newbookmark.asp?confilm=true&url='+encodeURIComponent(page_url));
}
function postBaqoo( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://baqoo.cc/add.php?mode=confirm&title='+escape(title_txt)+'&url='+escape(page_url));
}
function postReddit( title_txt, page_url, cite_txt )
{
// 注意: cite_txt の値は無視されます
window.open('http://ja.reddit.com/submit?url='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt));
}
function postDigg( title_txt, page_url, cite_txt )
{
// 注意: title_txt, cite_txt の値は無視されます
window.open('http://www.digg.com/submit?url='+encodeURIComponent(page_url));
}
function postExciteLinkPost( title_txt, page_url, cite_txt )
{
// 注意: page_url, cite_txt の値は無視されます
window.open('http://linkpost.news.excite.co.jp/page/w/?title=' + encodeURIComponent(title_txt));
}
/* メニュー画面生成 */
newWin = window.open("","Select");
newWin.document.open();
newWin.document.write('<html>\n');
newWin.document.write('<head><title>登録先選択</title>\n');
newWin.document.write('<meta http-equiv="Content-Script-Type" content="text/javascript">\n');
newWin.document.write('<script type="text/javascript">\n');
newWin.document.write('function nextAction()\n');
newWin.document.write('{\n');
newWin.document.write(' window.result = new Array(4);\n');
newWin.document.write(' window.result[0] = ""\n');
newWin.document.write(' window.result[1] = document.test.title.value;\n');
newWin.document.write(' window.result[2] = document.test.url.value;\n');
newWin.document.write(' window.result[3] = document.test.comment.value;\n');
newWin.document.write(' if ( document.test.hatena.checked == true ) window.result[0] += "1";\n');
newWin.document.write(' if ( document.test.delicious.checked == true ) window.result[0] += "2";\n');
newWin.document.write(' if ( document.test.mmMemo.checked == true ) window.result[0] += "3";\n');
newWin.document.write(' if ( document.test.bpTags.checked == true ) window.result[0] += "4";\n');
newWin.document.write(' if ( document.test.drecom.checked == true ) window.result[0] += "5";\n');
newWin.document.write(' if ( document.test.joltMark.checked == true ) window.result[0] += "6";\n');
newWin.document.write(' if ( document.test.flog.checked == true ) window.result[0] += "7";\n');
newWin.document.write(' if ( document.test.ecNavi.checked == true ) window.result[0] += "8";\n');
newWin.document.write(' if ( document.test.nifty.checked == true ) window.result[0] += "9";\n');
newWin.document.write(' if ( document.test.rootace.checked == true ) window.result[0] += "A";\n');
newWin.document.write(' if ( document.test.google.checked == true ) window.result[0] += "B";\n');
newWin.document.write(' if ( document.test.gmail.checked == true ) window.result[0] += "C";\n');
newWin.document.write(' if ( document.test.markezine.checked == true ) window.result[0] += "D";\n');
newWin.document.write(' if ( document.test.corich.checked == true ) window.result[0] += "E";\n');
newWin.document.write(' if ( document.test.blogHeadr.checked == true ) window.result[0] += "F";\n');
newWin.document.write(' if ( document.test.baqoo.checked == true ) window.result[0] += "G";\n');
newWin.document.write(' if ( document.test.reddit.checked == true ) window.result[0] += "H";\n');
newWin.document.write(' if ( document.test.digg.checked == true ) window.result[0] += "I";\n');
newWin.document.write(' if ( document.test.linkpost.checked == true ) window.result[0] += "J";\n');
newWin.document.write(' window.opener.updateParent( window );\n');
newWin.document.write('}\n');
newWin.document.write('</sc' + 'ript>\n');
newWin.document.write('</head>\n');
newWin.document.write('<body>\n');
newWin.document.write('<p>登録先を選択してください。</p>\n');
newWin.document.write('<form name="test" onkeydown="if (event.keyCode==13) { nextAction(); }">\n');
newWin.document.write('<table border="0">\n');
newWin.document.write('<tr><td>登録先: </td><td>\n');
newWin.document.write('<input type="checkbox" name="hatena" value="1">はてなブックマーク /\n');
newWin.document.write('<input type="checkbox" name="delicious" value="2">del.icio.us /\n');
newWin.document.write('<input type="checkbox" name="mmMemo" value="3">MM/Memo /\n');
newWin.document.write('<input type="checkbox" name="bpTags" value="4">BlogPeople Tags<br />\n');
newWin.document.write('<input type="checkbox" name="drecom" value="5">ドリコムRSS /\n');
newWin.document.write('<input type="checkbox" name="joltMark" value="6">JoltMark /\n');
newWin.document.write('<input type="checkbox" name="flog" value="7">Flog /\n');
newWin.document.write('<input type="checkbox" name="ecNavi" value="8">ECナビ人気ニュース<br />\n');
newWin.document.write('<input type="checkbox" name="nifty" value="9">ニフティクリップ /\n');
newWin.document.write('<input type="checkbox" name="rootace" value="A">ROOTACE /\n');
newWin.document.write('<input type="checkbox" name="google" value="B">Google Bookmark /\n');
newWin.document.write('<input type="checkbox" name="gmail" value="C">Gmail<br />\n');
newWin.document.write('<input type="checkbox" name="markezine" value="D">Markezine /\n');
newWin.document.write('<input type="checkbox" name="corich" value="E">CoRich /\n');
newWin.document.write('<input type="checkbox" name="blogHeadr" value="F">BlogHeader SBM /\n');
newWin.document.write('<input type="checkbox" name="baqoo" value="G">baqoo /\n');
newWin.document.write('<input type="checkbox" name="reddit" value="H">reddit /\n');
newWin.document.write('<input type="checkbox" name="digg" value="I">digg<br />\n');
newWin.document.write('<input type="checkbox" name="linkpost" value="J">Excite リンクポスト\n');
newWin.document.write('</td><tr>\n');
newWin.document.write('<tr><td>タイトル: </td><td><input type="text" name="title" value="'+ title_txt +'" size="80" /></td></tr>\n');
newWin.document.write('<tr><td>URL: </td><td><input type="text" name="url" value="'+ page_url +'" size="80" /></td></tr>\n');
newWin.document.write('<tr><td>コメント: </td><td><textarea name="comment" cols="60" rows="5">' + cite_txt + '</textarea></td></tr>\n');
newWin.document.write('<tr><td colspan="2">タイトル、URL、コメントは、この画面で変更したものが反映されます。</td></tr>\n');
newWin.document.write('</table>\n');
newWin.document.write('<input type="button" name="regist" value="実行" onclick="javascript:nextAction()" />\n');
newWin.document.write('</form>\n');
newWin.document.write('</body>\n');
newWin.document.write('</html>\n');
newWin.document.close();
newWin.resizeTo(640,600);
newWin.focus();
function updateParent( subwindow )
{
target = "";
count = 0;
if ( subwindow.result[0] != "" )
target = subwindow.result[0];
if ( subwindow.result[1] != "" )
title_txt = subwindow.result[1];
if ( subwindow.result[2] != "" )
page_url = subwindow.result[2];
if ( subwindow.result[3] != "" )
cite_txt = subwindow.result[3];
subwindow.close(); // 子 window をクローズ
window.close(); // ダミーで開いた prompt をクローズ
if ( target != "" )
count = target.length;
if ( target.match( "1" ) ) {
// はてなブックマークに登録
postHatenaBookmark( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("はてなブックマークへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "2" ) ) {
// del.icio.usに登録
postDelicious( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("del.icio.usへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "3" ) ) {
// MM/Memoに登録
postMMmemo( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("MM/Memoへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "4" ) ) {
// BlogPeople Tagsに登録
postBlogPeopleTags( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("BlogPeople Tagsへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "5" ) ) {
// ドリコムRSSに登録
postDrecomRSS( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("ドリコムRSSへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "6" ) ) {
// JoltMarkに登録
postJoltMark( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("JoltMarkへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "7" ) ) {
// Flogに登録
postFlog( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("Flogへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "8" ) ) {
// ECナビ人気ニュースに登録
postECnavi( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("ECナビ人気ニュースへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "9" ) ) {
// ニフティクリップに登録
postNiftyClip( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("ニフティクリップへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "A" ) ) {
// ROOTACEに登録
postRootace( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("ROOTACEへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "B" ) ) {
// Google Bookmarkに登録
postGoogleBookmark( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("Google Bookmarkへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "C" ) ) {
// Gmail を使って覚え書き(メールで送信)
postGmail( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("Gmailでの送信が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "D" ) ) {
// Markezineブックマークに登録
postMarkezine( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("Markezineへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "E" ) ) {
// CoRichに登録
postCoRich( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("CoRichへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "F" ) ) {
// BlogHeader SBMに登録
postBlogHeader( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("BlogHeader SBMへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "G" ) ) {
// baqooに登録
postBaqoo( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("Baqooへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "H" ) ) {
// redditに登録
postReddit( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("redditへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "I" ) ) {
// diggに登録
postDigg( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("diggへの登録が終わったら、OK を押してください");
count--;
}
}
if ( target.match( "J" ) ) {
// Exciteリンクポストに登録
postExciteLinkPost( title_txt, page_url, cite_txt );
if ( count >= 2 ) {
confirm("Exciteリンクポストへの登録が終わったら、OK を押してください");
count--;
}
}
// window.close(); // ダミーで開いた prompt をクローズ
}
/* subwindow.result を介してのウィンドウ間通信を機能させるため、*/
/* やむなくダミーのウィンドウを生成しておく */
prompt('ダミーのウィンドウです。\n作業が終わるまで、閉じないでそのままにしておいてください。','');
</script>
ソースをみていただければわかると思いますが、新しいソーシャルブックマークサービスが登場しても、そのサービス用にブックマークレットが用意されていれば、本スクリプトに取り込んで(そのまま取り込むのではなく、少しいじる必要がありますが)、あっという間に対応できてしまいます。本スクリプトが対応していないサービスで、対応させたいサービスがありましたら、どんどん追加していってみてください。
あと、
今回の版では、外部 Javascript として、“Paj’s Home: Cryptography: JavaScript MD5” にて公開されている md5.js を利用しています。
[観] 右クリックで はてなブックマーク、ついでに del.icio.us (2005年7月版)
本スクリプトも md5.js が必要です。別途、用意しておいてください。
追記
それぞれのサービスに専用のブックマークレットがあるので,ブラウザにいくつも登録しておくと混乱してくる。ちょうど財布の中にある無数のポイントカードのようで,いざ使おうというときに面倒なのだ。
Webの情報,どう整理してますか?---はてな,Googleなどの便利なブックマーク・サービス:ITpro
複数のサービスを使っているそんなあなた、 本スクリプトを1個、ブラウザに登録するだけで混乱を解消します。 このスクリプトさえ登録しておけば、好きなサービスをいつでも使えます。
どうぞご利用ください。
投稿者: tsupo 2006.06.08 午後 08:20
| 固定リンク
|
|
|
|
|
アマゾンわくわく探検隊
トラックバック
この記事のトラックバックURL:
この記事へのトラックバック一覧です: 複数のソーシャルブックマークサービスに同時に投稿するスクリプト:
» 複数のソーシャルブックマークサービスに同時に投稿するスクリプト (livedoorクリップ、next.1470.net対応版) from 観測気球
livedoorクリップ(2006年6月28日ベータ版サービス開始)とnext.1470.net(次期1470.net開発テストバージョン、2006年6月23日公開)にも対応してみました。ということで、最大21箇所同時にブックマークを投稿できるようになりました。... 続きを読む
» BMemoとはてぶ同時登録スクリプト from blog@slightlyblue
複数のソーシャルブックマークサービスに同時に投稿するスクリプト発見。 便利だけれ... 続きを読む
» 複数のソーシャルブックマークサービスに同時に投稿するスクリプト (newsing対応版) from 観測気球
2006年7月27日にオープンした newsing にも対応してみました。これで、22箇所へ同時に登録(クリップ)することができます。 続きを読む
コメント
ブクマスパム御用達になったらやだな…
投稿者: itochan (2006.06.26 午前 12:11)
このスクリプト(や類似機能を持ったツール)があってもなくても、ブックマークスパムする人はする訳です。
スパマーに利用されるのをおそれてツールを発表するのを控えるのも、何か変な話ですし、善良なブックマーカーの役に立つ可能性が少しでもあれば、それがどんなツールであっても、どんどん公開していった方がいいと思っています。
投稿者: tsupo (2006.06.26 午前 07:23)
はじめまして。とても便利なツールの公開、ありがとうございます。ソーシャルブックマークが大好きな1ユーザとして、ありがたく使わせていただきます。
投稿者: purprin (2006.07.25 午後 09:12)