ヘルプ

APIについて

codeなにがしでは、いくつかの機能をAPI経由で利用できるようになっています。

APIやブログパーツは順次・公開していく予定ですが、最新の開発状況などは、オープンタイプ株式会社ブログ をご覧下さい。

getSource.php

機能:
ソースコード・ノウハウの詳細を取得
URL:
http://api.code.nanigac.com/getSource.php
引数:
id: 取得するソースコードのID
comment: 取得するコメントの番号(*) default: all
fmt: 取得形式 [xml json] default: xml
jsonp: fmtがjson時には、ここで指定した名前で返します。default:無指定

(*)
無指定もしくはallは、全て
取得範囲は - もしくは , で指定可能(last は最後のコメント番号にマッチ)

例:
http://api.code.nanigac.com/getSource.php?id=1&fmt=json&jsonp=handler
http://api.code.nanigac.com/getSource.php?id=1&comment=1,4,8,10,11-last

APIの返すデータ形式

ソースコード・ノウハウの詳細(XML)
<?xml version="1.0" encoding="UTF-8"?>
<soruce>
  <author>
    <id>登録者のID</id>
    <name>登録者のニックネーム</name>
    <regdate>登録日時(YYYY/MM/DD HH:MM)</regdate>

    <modifier_id>最終更新者のID</modifier_id>
    <modifier_name>最終更新者のニックネーム</modifier_name>
    <modify_date>登録日時(YYYY/MM/DD HH:MM)</modify_date>
    <image>登録者の画像(URL)</image>
  </author>

  <entry>
    <id>ソースコードID</id>
    <title>ソースコードのタイトル</title>
    <access_num>アクセス数</access_num>
    <relate_id>関連トピックID</relate_id>
    <relate_name>関連トピック名</relate_name>
    <gj>GoodJobの数</gj>
    <tagdata>
      <tag>タグ名</tag>
      <tag>タグ名</tag>
           ・
           ・
           ・
    </tagdata>
    <description>説明</description>
    <sourcecode>ソースコード</sourcecode>
    <comment_num>コメント数</comment_num>
  </entry>

  <comment>
    <num>コメント番号</num>
    <id>登録者のID</id>
    <name><登録者のニックネーム</name>
    <regdate>登録日時</regdate>
    <image>登録者の画像(URL)</image>
    <description>コメント内容</description>
  </comment>
  <comment>
     ・
     ・
     ・
  </comment>
</source>
ソースコード・ノウハウの詳細(JSON)
{
"auth_id":登録者のID,
"auth_name":"登録者のニックネーム",
"auth_regdate":"登録日時", (※例:2007-08-22T13:56:30+09:00)
"auth_modifier_id":最終更新者のID,
"auth_modifier_name":"最終更新者のニックネーム",
"auth_modify_date":"登録日時",
"auth_image":登録者の画像(URL)",

"entry":{
"src_id":ソースコードID,
"src_title":ソースコードのタイトル,
"src_access_num":アクセス数,
"src_relate_id":関連トピックID,
"src_relate_name":"関連トピック名",
"src_gj":GoodJobの数,
"src_description":"説明",
"src_sourcecode":"ソースコード",
"src_comment_num":コメント数
},

"tagdata":[
  {"tag":"タグ名"},
      ・
      ・
  {"tag":"タグ名"}
],

"commnt":[{
"com_num":コメント番号,
"com_id":登録者のID,
"com_name":"登録者のニックネーム",
"com_regdate":"登録日時",
"com_image":"登録者の画像(URL)",
"com_description":"コメント内容"
},
{
・
・
・
}
]
}