�Ȥ�������ǡ������ɤ����ߤƤ���

Use YJParse

�ߤƤ��ΤȤ� �����ʤ���֤���ޤ� �� Yahoo!���ܸ�����Dz��� ��Ĥä��� ���֥��å²� �Ǥ褦�뤭�� �����ޤ�Ƥ�����404 Blog Not Found:Yahoo API + Google = �桼�����פ��饳���ɤ� �Ѥä��� �Τǡ������� �Ǥޤ������� ����Yahoo!���ܸ�����Dz��� �� �郎������ �� �����ޤ����� ��ʸ���ʾ�� ���������� �� �ʤʤ��� ���夲�Ĥ� ���ʤ� �Τǡ��Ĥʤ襤���� ���֥��å� �������ۤ� �������⤤ ��Ǥ�����

������ �褿��� �ϤΤ� �褷����

����������

JS Source:

yjparse = new (function(proxy, callback){
  this.proxy     = proxy || 'http://api.dan.co.jp/yjparse';
  this.callback  = callback || 'jsonp';
  this.parse = function(str, callback){
    if (! callback) callback = this.callback;
    var script = document.createElement('script'); 
    script.id = this.proxy + '?c=' + callback + '&s=' + encodeURIComponent(str);
    script.charset = 'UTF-8';
    script.src = script.id; 
    document.lastChild.appendChild(script);
  };
  return this;
});

jsonp = function(jsonp){
  do_kebunridge(jsonp.ma_result.word_list.word);
};

do_kebunridge = function(words){
  var reading = [];
  dst.innerHTML = '';
  for (var i = 0, l = words.length; i < l; i++){
    reading[i] = kebunridge(words[i].reading || words[i]);
  }
  document.getElementById('dst').innerHTML = reading.join(' ');
}

kebunridge = function(str){
    if (!str) return str;
    if (str.length < 4) return str;
    var head = str.charAt(0);
    var tail = str.charAt(str.length-1);
    var mid = str.slice(1, str.length-1);
    return head + shuffle(str2ary(mid)).join('') + tail;
};

str2ary = function(str){
    var ary = [];
    for (var i = 0, l = str.length; i < l; i++) ary[i] = str.charAt(i);
    return ary;
};

shuffle = function(ary){ //v1.0
    for(var j, x, i = ary.length; i;
        j = parseInt(Math.random() * i), 
        x = ary[--i], ary[i] = ary[j], ary[j] = x);
return ary;
};