Skip to content

Instantly share code, notes, and snippets.

@mersy
Last active December 24, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mersy/3486116e0d5685c09328 to your computer and use it in GitHub Desktop.
Save mersy/3486116e0d5685c09328 to your computer and use it in GitHub Desktop.
// Data API オブジェクトの作成する。Data APIを利用する必須の事前準備。
var api = new MT.DataAPI({
baseUrl: "<mt:Var name="website_url">mt/mt-data-api.cgi",
clientId: "BfYMqpO2RzkZepaSh8G2"
});
// Data API に渡すパラメータをセット
var params = {
status: "Publish", // 公開記事のみ
offset: 0, // 初期化しておく
limit: <$mt:Var name="limit_count"$>, // configモジュールで設定
fields: "id,title,permalink,customFields,categories,date,assets" // 返ってくるieldを限定しておく
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment