Table of Contents

JSONインタフェース

CxB RankPoint Simulatorのデータベースに登録されているデータをJSONで取得できます

公開インタフェースはすべてJSONPに対応しています。Content-Typeは以下で返却します

JSON形式での返却
application/json; charset=utf-8
JSONP形式での返却
application/javascript; charset=utf-8

楽曲情報単曲取得

パラメータ

項目説明
楽曲番号(必須)コレクションでの連番に準じる番号
コールバック関数名(任意)指定がある場合、コールバック関数でデータをくくってJSONP形式で返却します

URI

リクエスト先URI
http://cxbrank.maplia.jp/api/music/[楽曲番号]?callback=[コールバック関数名]
サンプルURI
http://cxbrank.maplia.jp/api/music/63

レスポンスフィールド

フィールドの出現順序は不定です(保証しません)

フィールドキー名説明
楽曲番号numbernumericコレクションでの連番に準じる番号
タイトルtitlestring楽曲のタイトル(サブタイトルを除く)
サブタイトルsubtitlestring楽曲のサブタイトル(ない場合はnull)
フルタイトルfull_titlestring楽曲の全体タイトル(タイトル+半角スペース+サブタイトル)
期間限定フラグlimitedbool未配信のイベント先行出現曲の場合にtrue、それ以外はfalse
月間RP曲フラグmonthlyboolリクエスト時点の月間RP曲である場合にtrue、それ以外はfalse
STANDARD譜面情報std(ネスト)
レベルlevelnumeric譜面の設定レベル(float値で返却します)
ノート数notesnumeric譜面の総ノート数(ノート種類は区別しません)
HARD譜面情報hrd(ネスト)
レベルlevelnumeric同上
ノート数notesnumeric
MASTER譜面情報mas(ネスト)
レベルlevelnumeric同上
ノート数notesnumeric
EASY譜面情報esy(ネスト)
レベルlevelnumericnull固定
ノート数notesnumericnull固定
UNLIMITED譜面情報unl(ネスト)
レベルlevelnumericnull固定
ノート数notesnumericnull固定

楽曲情報一括取得

パラメータ

項目説明
コールバック関数名(任意)指定がある場合、コールバック関数でデータをくくってJSONP形式で返却します

URI

リクエスト先URL
http://cxbrank.maplia.jp/api/musics?callback=[コールバック関数名]
サンプルURI
http://cxbrank.maplia.jp/api/musics

レスポンスフィールド

単曲取得と同じ構成のオブジェクトを配列にして、データベースにあるすべての楽曲データを返却します。配列の並びは楽曲番号の昇順です

データ登録インタフェース

プレイ成績データをJSON形式でPOST送信することで、Webでのログインを経ずに直接データの編集ができます

Content-Typeはapplication/jsonで送信(application/x-www-form-urlencodedにはしない)

1曲単位の更新のみ受け付けます(複数更新する場合はその件数だけリクエストする)

リクエストフィールド

ここに含まれるキー以外はすべて無視します

フィールドキー名説明
ユーザIDuser_idstringユーザのID(数字5ケタ)
パスワードpasswordstringユーザのパスワード
楽曲番号numbernumericコレクションでの連番に準じる番号
プレイ成績データskill(ネスト)
コメントcommentstringプレイ成績データに関するコメント







STANDARD譜面std(ネスト)(※省略可能にする予定: 未プレイ状態にする)
プレイ状態statnumeric0:未プレイ、1:クリア済み、2:クリア失敗
RPpointnumeric譜面のRP(小数点以下2ケタのfloat値)
クリアレートratenumeric譜面のクリアレート(0~100のint値)
クリアレートranknumeric0:指定なし、1:S++、2:S+、~、9:D、10:E
フルコンボfcsnumeric0:指定なし、1:フルコンボ、2:All Flawless(エクセ)
ロック状態lockednumeric0:ロックなし、1:ロック状態(または未所持)







HARD譜面hrd(ネスト)
プレイ状態statnumeric同上
RPpointnumeric
クリアレートratenumeric
クリアレートranknumeric
フルコンボfcsnumeric
ロック状態lockednumeric







MASTER譜面mas(ネスト)
プレイ状態statnumeric同上
RPpointnumeric
クリアレートratenumeric
クリアレートranknumeric
フルコンボfcsnumeric
ロック状態lockednumeric

URI

リクエスト先URI
http://cxbrank.maplia.jp/edit_direct

レスポンス

HTTPステータスコードで処理結果を返却します

成否ステータス説明
成功200OK更新(または新規作成)成功
失敗400Bad Request送信データ不備(該当曲が存在しない、バリデーションを通らないなど)
401Unauthorizedユーザ認証失敗(パスワード間違いなど)
405Method Not AllowedリクエストがPOSTメソッドでない
500Internal Server Errorその他の内部エラー(プログラム側のバグかも)

js

(function(jQuery) {
  // プログレスダイアログ
  jQuery.progress = function (title) {
    if (jQuery('body').find('#progress-dialog').length == 0) {
      jQuery('body').append('<div id="progress-dialog"><table id="progress-table"><tbody><tr><td id="progress-message1"></td></tr><tr><td id="progress-message2"></td></tr><tr><td><div id="progressbar"></div></td></tr></tbody></table></div>');
      jQuery('#progress-dialog').dialog({
        title: title, autoOpen: false, modal: true, width: 450, height: 260,
        draggable: false, resizable: false, closeOnEscape: false,
        buttons: {
          'キャンセル': function () {
            jQuery.progress.cancel();
            if (jQuery.progress.cancelCallback) {
              jQuery.progress.cancelCallback();
            }
          }
        }
      });
      jQuery('#progress-table').css('width', '100%');
      jQuery('#progress-table').css('font-size', '1.1em');
      jQuery('#progress-table tr td').css('height', '1.4em');
    }
    return this.extend(jQuery.progress, {
      open: function (cancelCallback) {
        this.canceled = false;
        this.cancelCallback = cancelCallback;
        jQuery('#progress-type').text('');
        jQuery('#progress-title').text('');
        jQuery('#progressbar').progressbar({
          max: 0, value: false
        });
        jQuery('#progress-dialog').dialog('open');
        jQuery('.ui-dialog-titlebar-close').hide();
        return this;
      },
      close: function () {
        jQuery('#progress-dialog').dialog('close');
      },
      cancel: function () {
        console.log('canceled!');
        this.canceled = true;
      },
      isCanceled: function () {
        return this.canceled;
      },
      setMessage1: function (message) {
        jQuery('#progress-message1').text(message);
      },
      setMessage2: function (message) {
        jQuery('#progress-message2').text(message);
      },
      setProgressbarMax: function (max) {
        jQuery('#progressbar').progressbar({
          max: max, value: 0
        });
      },
      incProgressbarValue: function () {
        jQuery('#progressbar').progressbar('value', jQuery('#progressbar').progressbar('value') + 1);
      }
    });
  };
  // メッセージ表示ダイアログ
  jQuery.alert = function (message, title) {
    var deferred = jQuery.Deferred();
    if (jQuery('body').find('#alert-dialog').length == 0) {
      jQuery('body').append('<div id="alert-dialog"><p id="alert-message"></p></div>');
      jQuery('#alert-dialog').dialog({
        title: title, autoOpen: false, modal: true, width: 450, height: 250,
        draggable: false, resizable: false, closeOnEscape: false,
        buttons: {
          'OK': function () {
            jQuery('#alert-dialog').dialog('close');
            deferred.resolve();
          }
        }
      });
    }
    jQuery('#alert-message').text(message);
    jQuery('#alert-dialog').dialog('open');
    jQuery('.ui-dialog-titlebar-close').hide();
    return deferred.promise();
  };
  // 確認ダイアログ
  jQuery.confirm = function (message, title, acceptCallback, cancelCallback) {
    var deferred = jQuery.Deferred();
    jQuery.confirm.self = this;
    jQuery.confirm.self.acceptCallback = acceptCallback;
    jQuery.confirm.self.cancelCallback = cancelCallback;
    if (jQuery('body').find('#confirm-dialog').length == 0) {
      jQuery('body').append('<div id="confirm-dialog"><p id="confirm-message"></p></div>');
      jQuery('#confirm-dialog').dialog({
        title: title, autoOpen: false, modal: true, width: 450, height: 250,
        draggable: false, resizable: false, closeOnEscape: false,
        buttons: {
          'はい': function () {
            jQuery('#confirm-dialog').dialog('close');
            jQuery.confirm.self.acceptCallback();
            deferred.resolve();
          },
          'いいえ': function () {
            jQuery('#confirm-dialog').dialog('close');
            jQuery.confirm.self.cancelCallback();
            deferred.reject();
          }
        }
      });
    }
    jQuery('#confirm-message').text(message);
    jQuery('#confirm-dialog').dialog('open');
    jQuery('.ui-dialog-titlebar-close').hide();
    return deferred.promise();
  };
})(jQuery);

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS