複数のソーシャルブックマークサービスに同時に投稿するスクリプト (livedoorクリップ、next.1470.net対応版)

観測気球

収集物の記録書庫 a data archive of collection -- collectible toys

[要旨] livedoorクリップ(2006年6月28日ベータ版サービス開始)とnext.1470.net(次期1470.net開発テストバージョン、2006年6月23日公開)にも対応してみました。ということで、最大21箇所同時にブックマークを投稿できるようになりました。
[キーワード] ソーシャルブックマーク

« Amazonおまかせリンク | トップページ | ソーシャルブックマーク管理ツール bookey 0.10版 (livedoorクリップにも対応しました) »

2006.06.28

複数のソーシャルブックマークサービスに同時に投稿するスクリプト (livedoorクリップ、next.1470.net対応版)

複数のソーシャルブックマークサービスに同時に投稿するスクリプト」を拡張し、 livedoorクリップnext.1470.net にも対応してみました。ってことで、最大21箇所同時にブックマークを投稿できるようになりました。

next.1470.net

まだプロトタイピングの段階なんで、ベータとか以前のバージョンだけど、だいぶまとまってきたんで、いったん晒してみる。まだ実用レベルではないし、データも保全しない可能性が高い(DB設計からやり直す可能性がある)のでそのつもりでどうぞ。

1470.netリニューアル開発テストバージョン - いしなお! (2006-06-23)

MM/Memo や blogmap といったサービスが提供中の 1470.net のishinaoさんによる実験的なサービスです。次期 1470.net がどんな感じになるか、興味のある人は参加してみては? ただし、最終的には今とは全く違うものになるかもしれないこと、登録したデータが本番システムまで保持されない可能性があること、仕様変更が頻繁に行なわれること、など、現段階では常用するためのサービスではありません。使ってみる場合は、その辺、注意してください。ただ、いろいろ面白い機能が実装されつつありますので、そういうのが好きな人には楽しめると思います。

livedoor クリップ

いずれ livedoor もソーシャルブックマークサービスを始めるだろうと予想されていましたが、ようやく始まりました。 まだまだ、これからどんどんいろんな機能が実装されていくようです。livedoor Reader との連携機能も予定されているとのこと。今後の成長に期待しています。

livedoor clipでは、通常のソーシャルブックマークの機能に加えて、記事単位での非公開設定詳細)や、使い方にあわせてブックマークレットカスタマイズできるブックマークジェネレータ詳細)などをご用意しております。

livedoor clip開発日誌:liveoor clip(ソーシャルブックマーク)はベータ版です - livedoor Blog(ブログ)

ぱっと見、他のソーシャルブックマークからいろんな機能を取り込んだ感じ。ブックマーク元記事を5段階評価できたり、ブックマークごとにパブリック(公開)/プライベート(非公開)を指定できたり。そのうち、スクリーンショット機能も付くのでしょう。

ブックマーク同時投稿スクリプト

このスクリプトは、結構癖のある動きをします。1つのブックマークサービスしか使わない場合は、そんなに問題はないと思うんですが、複数のブックマークサービスに同時に投稿しようとするとき、不用意に、ウィンドウを閉じてしまうと、そこで処理が終わって、残りのブックマークサービスに投稿できない、というようなこともあります。使っているうちに、その辺はわかってくると思いますが、ある程度使い慣れないと、全然使い物にならないかもしれません。

そもそも、ネタとして作ったという側面が大きく、あまり実用的ではないと思います。とはいえ、慣れれば、(たぶん)使いこなせるようになりますので、全く使えない代物という訳でもありません。とかなんとか、言い訳してみるテストでした (^^;

ソース

それでは、以下、「複数のソーシャルブックマークサービスに同時に投稿するスクリプト (livedoorクリップ、next.1470.net対応版)」のソースです。設置にあたっての注意点等、こまかいことは「複数のソーシャルブックマークサービスに同時に投稿するスクリプト」を参照してください。

<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.2  2006/06/28 livedoor クリップ、next.1470.net にも対応した         */
/*    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)+'&amp;title='+encodeURIComponent(title_txt)+'&amp;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)+'&amp;title='+encodeURIComponent(title_txt)+'&amp;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&amp;tf=1&amp;cmid=2&amp;init=1&amp;fs=1';
    d += '&amp;su=' + page_title + '&amp;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));
}

function postLivedoorClip( title_txt, page_url, cite_txt )
{
    if ( cite_txt != "" )
        window.open('http://clip.livedoor.com/clip/add?link='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt)+'&notes='+encodeURIComponent(cite_txt));
    else
        window.open('http://clip.livedoor.com/clip/add?link='+encodeURIComponent(page_url)+'&title='+encodeURIComponent(title_txt));
}

function postNext1470Net( title_txt, page_url, cite_txt )
{
    if ( cite_txt != "" )
        window.open('http://next.1470.net/tools/memo/new?url='+encodeURIComponent(page_url)+'&comment='+encodeURIComponent(cite_txt)); // コメントは反映されない(反映されることも、ごくたまにある?)
    else
        window.open('http://next.1470.net/tools/bookmark?url='+encodeURIComponent(page_url));
}

/* メニュー画面生成 */
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('    if ( document.test.livedoor.checked  == true ) window.result[0] += "K";\n');
newWin.document.write('    if ( document.test.next1470.checked  == true ) window.result[0] += "L";\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('<input type="checkbox" name="livedoor"  value="K">livedoor クリップ\n');
newWin.document.write('<input type="checkbox" name="next1470"  value="L">next.1470.net\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 をクローズ

    if ( target != "" ) {
        count = target.length;
        confirm("ブックマークの投稿を開始します (投稿先: " + count + "件)");
    }
    window.close();    // ダミーで開いた prompt をクローズ

    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--;
        }
    }
    if ( target.match( "K" ) ) {
        // livedoor クリップ に登録
        postLivedoorClip( title_txt, page_url, cite_txt );
        if ( count >= 2 ) {
            confirm("livedoor クリップへの登録が終わったら、OK を押してください");
            count--;
        }
    }
    if ( target.match( "L" ) ) {
        // next.1470.net に登録
        postNext1470Net( title_txt, page_url, cite_txt );
        if ( count >= 2 ) {
            confirm("next.1470.netへの登録が終わったら、OK を押してください");
            count--;
        }
    }
}

/* subwindow.result を介してのウィンドウ間通信を機能させるため、*/
/* やむなくダミーのウィンドウを生成しておく                     */
prompt('ダミーのウィンドウです。\n作業が終わるまで、閉じないでそのままにしておいてください。','');
</script>

投稿者: tsupo 2006.06.28 午後 07:41 | 固定リンク | このエントリーをはてなブックマークに追加 | このエントリを del.icio.us に登録 このエントリの del.icio.us での登録状況 | このエントリを Buzzurl に追加このエントリの Buzzurl での登録状況 | このエントリをlivedoorクリップに登録 このエントリのlivedoorクリップでの登録状況 このエントリをlivedoorクリップに登録している人の数 | 酢鶏巡回中

楽天市場


品揃え豊富で安い!NTT-X Store


アマゾンわくわく探検隊

トラックバック

この記事のトラックバックURL:

この記事へのトラックバック一覧です: 複数のソーシャルブックマークサービスに同時に投稿するスクリプト (livedoorクリップ、next.1470.net対応版):

» 複数のソーシャルブックマークサービスに同時に投稿するスクリプト (newsing対応版) from 観測気球
2006年7月27日にオープンした newsing にも対応してみました。これで、22箇所へ同時に登録(クリップ)することができます。 続きを読む

受信: 2006.07.27 午後 03:01

コメント

ワード

ニッセン

fujisan.co.jp

楽天市場