ヤフオクの取引ナビ(ベータ版)からクリックポスト用データをコピーする

    
      
  • /*
     * @title ヤフオクの取引ナビ(ベータ版)からクリックポスト用データをコピーする
     * @description 「クリックポストの新規発送フォームを一括入力する」と合わせて使用してください
     *
     * ヤフオクの取引ナビベータ版のページで実行すると、プロンプトウィンドウが開きます。
     * 「オークションタイトル,郵便番号(上3桁),郵便番号(下4桁),住所,名前,電話番号」
     * といった形式のテキストが表示されていますので、コピーしてください。
     * タイトルと住所はクリックポスト用に整形しています。
     * タイトル: 半角英数を全角に置き換え、15文字以上は切り捨て
     * 住所: 半角英数を全角に置き換え、20文字以上の場合は適宜改行を挿入
     * 
     * クリックポストの新規発送ページに移動後、
     * 「クリックポストの新規発送フォームを一括入力する」
     * http://let.hatelabo.jp/mitsube/let/hJmf08Ws8scO
     * を実行し、コピーしていたものをペーストしてください。
     * 
     * @include https://contact.auctions.yahoo.co.jp/seller/*
     * @license MIT License
     * @javascript_url
     */
    
    // (function(){
    
    //         var table = [];
    //         var i, prmpt;
    
    //         String.prototype.capitalize = function(){
    //                 return this.replace(/[A-Za-z0-9\-]/g, function(s) {
    //                         return String.fromCharCode(s.charCodeAt(0) + 0xFEE0);
    //                 }).replace(/ /g,"");
    //         };
    
    //         String.prototype.paragraph = function(){
    //                 var str = this;
    //                 if (str.length > 20) {
    //                       str = str.replace(/^(.+[1-9][0-9]*)(.*)/, '$1\n$2');
    //                 }
    //                 return str.toString();
    //         }
    
    //         $('.decCnfWr').each(function(i){
    //                 table.push($(this).text());
    //         });
    
    //         function isClickpost(index_clickpost){
    //                 return table[index_clickpost].indexOf('クリックポスト') === 0;
    //         }
    
    //         if( isClickpost(6) ) {
    //                 i = 1;
    //         } else if ( isClickpost(5) ) {
    //                 i = 0;
    //         }else{
    //                 alert('error!');
    //                 return;
    //         }
    
    //         var bidder = [
    //                 $('.decItmName').text().capitalize().substr(0,15),      // print_title
    //                 table[i+2].substr(1,3),   // zip1
    //                 table[i+2].substr(4,4),   // zip2
    //                 table[i+3].capitalize().paragraph(),    // reciver_adress
    //                 table[i+1],       // receiver_name
    //                 table[i+4],       // receiver_phone
    
    //         ];
            
    //         prmpt = prompt('コピーしてください',bidder.toString());
    //         console.log();
    //         if( prmpt !== null ){
    //                 document.location.href = "//click-post.secure.force.com/";
    //         }
    
    // })();
    
    !function(){function t(t){return 0===n[t].indexOf("クリックポスト")}var r,e,n=[];if(String.prototype.capitalize=function(){return this.replace(/[A-Za-z0-9\-]/g,function(t){return String.fromCharCode(t.charCodeAt(0)+65248)}).replace(/ /g,"")},String.prototype.paragraph=function(){var t=this;return t.length>20&&(t=t.replace(/^(.+[1-9][0-9]*)(.*)/,"$1\n$2")),t.toString()},$(".decCnfWr").each(function(){n.push($(this).text())}),t(6))r=1;else{if(!t(5))return void alert("error!");r=0}var o=[$(".decItmName").text().capitalize().substr(0,15),n[r+2].substr(1,3),n[r+2].substr(4,4),n[r+3].capitalize().paragraph(),n[r+1],n[r+4]];e=prompt("コピーしてください",o.toString()),console.log(),null!==e&&(document.location.href="//click-post.secure.force.com/")}();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/02/03 12:40:02 - 2016-02-03