Skip to content

Instantly share code, notes, and snippets.

@egoist
Last active August 29, 2015 14:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egoist/85c12f9f0544544f40a3 to your computer and use it in GitHub Desktop.
Save egoist/85c12f9f0544544f40a3 to your computer and use it in GitHub Desktop.
里世界のAPI 1.0

Parameters:

  • page: 分页,默认为 1
  • limit: 每页数量,默认为 20

###获取最新状态

GET https://insekai.com/api/latest

TEST OK

[  
   {  
      "tokio_id": "1963",
      "uid": "1",
      "ruid": null,
      "tokio_type": "0",
      "keywords": null,
      "content":"",
      "content_rendered":"",
      "email_hash":"b33d0211bbd11599d524b3ff39aa9f9a",
      "addtime":"1420129348",
      "updatetime":"1420129348",
      "lastreply":"1420129348",
      "views":"11",
      "comments":"0",
      "favorites":"0",
      "ua":"Mac OS X",
      "closecomment":null,
      "is_top":"0",
      "is_hidden":"0",
      "toid":"0",
      "stickyto":null,
      "recommend":"0",
      "is_private":"0",
      "is_todo":"0",
      "username":"0x142857",
      "avatar":null,
      "nickname":"\u811a\u672c\u91cd\u751f"
   },
   
]

###获取用户状态

Get https://insekai.com/api/:username/timeline

TEST OK

[
    {
        "tokio_id": "1964",
        "uid": "1",
        "ruid": null,
        "tokio_type": "0",
        "keywords": null,
        "photos": null,
        "content": "Why Android is terrible https://mustlog.github.io/#!dd12f840836911dc7434",
        "addtime": "1420150883",
        "updatetime": "1420150883",
        "lastreply": "1420150883",
        "views": "20",
        "comments": "0",
        "favorites": "0",
        "ua": "Mac OS X",
        "closecomment": null,
        "is_top": "0",
        "is_hidden": "0",
        "toid": "0",
        "stickyto": null,
        "recommend": "0",
        "is_private": "0",
        "is_todo": "0",
        "username": "0x142857",
        "avatar": null,
        "nickname": "脚本重生",
        "content_rendered": "Why Android is terrible <a rel=\"nofollow\" href=\"https://mustlog.github.io/#!dd12f840836911dc7434\" target=\"_blank\" >mustlog.github.io/#!dd12f840836911dc7434</a>",
        "email_hash": "b33d0211bbd11599d524b3ff39aa9f9a"
    },
]

###发布新状态

POST https://insekai.com/api/status/new

TEST UNTESTED

需要传递的参数:

  • content : 状态内容
  • is_private : 0/1, 0 为公开, 1 为秘密
  • user_private_key : 在 /settings 页面底部生成的密钥
{
   "uid": "1",
   "username": "0x142857",
   "nickname": "0x142857",
   "tokio_id": "1987",
   "content": "",
   "unrendered": "",
   "addtime": "1420150883"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment