Henry's Notebook
Many strange things
搜索
菜单
导航
首页
最近更改
随机页面
帮助
Henry's Home
个人资料
个人资料
创建账户
登录
消息
目前您没有通知。请访问您的
讨论页
以查看过去消息。
页面工具
内容页面
讨论
查看源代码
历史
首页
»
页面s
查看“BBS数据接口”的源代码
←
BBS数据接口
页面上次由
HenryHu
编辑于9年前
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:emailconfirmed
您可以查看与复制此页面的源代码。
== JSONP == {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional |- | jsonp || string || JSONP function name || Yes |- | jsoncallback || string || JSONP function name || Yes |} If you want JSONP, just add '''jsonp=function''', and the result would be <source lang='javascript'> function(data); </source> == 登录 == [[BBS OAuth]] == 版面 == === 列出版面 === : '''GET''' /board/list {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional |- | session || string || Session Token || No |- | start || int || ID of the first post to list || Yes |- | end || int || ID of the last post to list || Yes |- | count || int || Number of posts to list || Yes |} * Return value ** Success: [{"name": <string: Board name>, "read": <Boolean: Board read?>, "BM": <string: BMs>, "id": <int: Board id>, "total": <int: Total post count>, "currentusers": <int: Current users count>, "major": <int: major class>, "minor": <string: minor class>, "output": <string: may output>, "desc": <string: description>},{...}...] === 获取帖子列表 === : '''GET''' /board/post_list {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional !! Choices |- | session || string || Session Token || No |- | name || string || Name of the board to list || No |- | mode || string || Mode of this board to list || Yes || '''normal'''/digest/mark |- | start || int || ID of the first post to list || Yes |- | end || int || ID of the last post to list || Yes |- | count || int || Number of posts to list || Yes |} * Return value ** Success: [{"posttime": <time: post time>, "attachflag": <int: unknown>, "read": <Boolean: Post read>, "title": <string: Post title>, "attachment": <int: Attachment count>, "owner": <string: Poster userid>, "id": <int: Post id>, "xid": <int: unique post ID>}, {...}...] == 帖子 == === 获取帖子 === : '''GET''' /post/view {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional |- | session || string || Session Token || No |- | id || int || ID of the post in this board || No |- | board || string || Name of the board this post belongs to || No |} * Return value ** Success: {"picattach": [{"name": <string: Attachment filename>, "offset:": <int: Attachment offset in post>}, {...}...], "title": <string: Post title>, "content": <string: Post content>, "otherattach": [{...}...], "owner": <string: Poster>, "id": <int: Post ID>, "xid": <int: unique post ID>} === 获取附件 === : '''GET''' /post/get_attach {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional !! Choices |- | session || string || Session Token || No |- | id || int || ID of the post in this board || No |- | board || string || Name of the board this post belongs to || No |- | mode || string || Mode of the board this ID corresponds to || Yes || '''normal'''/digest/mark |- | offset || int || Offset of the attachment in the post, returned in "view" || No |} * Result value ** {"content": <string: Post content encoded in Base64>, "name": <string: Attachment name>} === 同主题浏览 === : '''GET''' /post/nextid {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional !! Choices |- | session || string || Session token || No || |- | id || int || Post ID to start search from || No || |- | board || string || Board name || No || |- | direction || string || Search direction || Yes || '''forward'''/backward |- | last_one || bool || Search for the last post || Yes || '''0'''/1 |- | only_new || bool || Only search for new post || Yes || '''0'''/1 |} * Result ** {'nextid': <int: next post id in the thread>} * Examples ** direction=forward: search for next post in the same thread ** direction=backward, last_one=1: go to the head of the thread ** direction=backward, last_one=1, only_new=1: go to the first unread post in the thread === 引用帖子 === : '''GET''' /post/quote {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional !! Choices |- | session || string || Session Token || No |- | board || string || Name of the board this post belongs to || No |- | id || int || ID of the post to quote || No |- | xid || int || unique ID of the post to quote || No |- | mode || string || quote mode || Yes || '''S'''/R/N/A |- | index_mode || string || mode of the post list where ID belongs to || Yes || '''normal'''/digest/mark |} * Result ** {"title": <string: Quoted title>, "content": <string: Quoted content>} === 准备 === : '''GET''' /post/prepare {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional !! Choices |- | session || string || Session Token || No || |- | for || string || action to prepare for || No || new |- | board || string || Name of the board this post belongs to || No || |- | re_id || int || ID of the post to reply (for=new) || Yes || |- | re_xid || int || unique ID of the post to reply (for=new) || Yes || |- | re_mode || string || mode of the post list where re_id belongs to (for=new) || Yes || '''normal'''/digest/mark |- | anonymous || boolean || create anonymous post (for=new) || Yes || '''0'''(no)/1(yes) |} result: {"error": {<string: error 1>: 1}} 如果没错误,那后面的hash是空的。 === 发帖/回帖 === : '''POST''' /post/new {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional !! Choices |- | session || string || Session Token || No || |- | board || string || Name of the board this post belongs to || No || |- | re_id || int || ID of the post to reply || Yes || |- | re_xid || int || unique ID of the post to reply || Yes || |- | re_mode || string || mode of the post list where re_id belongs to || Yes || '''normal'''/digest/mark |- | title || string || title of the post || No || |- | content || string || content of the post || No || |- | signature_id || int || No. of qmd to use || Yes || <0(random)/'''0'''(none)/>0(qmd #) |- | anonymous || boolean || create anonymous post || Yes || '''0'''(no)/1(yes) |- | mailback || boolean || require replies to be mailed back || Yes || '''0'''(no)/1(yes) |} 发帖的话,id和xid可以忽略。回帖的话,需要提供id和xid。 == 收藏夹 == === 列出收藏夹 === : '''GET''' /favboard/list {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional |- | session || string || Session Token || No |- | father || int || Parent directory of boards to list || Yes |- | start || int || ID of the first post to list || Yes |- | end || int || ID of the last post to list || Yes |- | count || int || Number of posts to list || Yes |} * Return value ** Success: [{"index": <int: Index in favboard>, "binfo": <BoardInfo: board info>, "father": <int: Parent index in favboard>, "type": <string: Type of this entry>}, {...}...] == 会话 == === 验证会话 === : '''GET''' /session/verify {| class="wikitable" |- ! Parameter !! Type !! Description !! Optional |- | session || string || Session Token || No |}
返回至
BBS数据接口
。