EMLOG

JSON API

适配版本:6.0.0,5.3.1

售价:免费

更新时间:2015-04-08


作者:JohnLui 查看作者主页


请进入emlog后台商店安装

使用说明

JSON API for Emlog

--

强大的 JSON 格式的数据输出插件,为 Emlog 而生。基于 TinyLara 框架。

Github 开源项目地址:https://github.com/johnlui/JSON-API-for-Emlog



API


所有 API 后面务必加上 ?token=koanfoiuh32789gf782bqwiubuyiqwgd

该值在 content/plugins/json_api/tinylara/config/routes.php 中修改。



1.获取管理员信息

http://ooxx.com/content/plugins/json_api/tinylara/public/admin-info

返回值:

```json

{

"nickname": "John·Lui",

"photo": "http://blog.io/content/uploadfile/201402/thum-d1241391266636.jpg",

"email": "wenhanlv@gmail.com",

"description": "Nothing."

}

```


2.获取站点信息

http://ooxx.com/content/plugins/json_api/tinylara/public/site-info

返回值:

```json

{

"blogname": "岁寒",

"bloginfo": "岁寒,然后知松柏之后凋也!"

}

```


3.从第 0 篇到第 2 篇文章

http://ooxx.com/content/plugins/json_api/tinylara/public/articles/from/0/to/2

返回值:

```json

[

{

"gid": 2,

"title": "Welcome To John·Lui's Personal Blog",

"date": 1323699410,

"content": "<span>面朝大海,春暖花开</span>",

"excerpt": "<span>面朝大海,春暖花开</span>",

"alias": "",

"author": 1,

"sortid": 4,

"type": "blog",

"views": 2129,

"comnum": 0,

"attnum": 0,

"top": "n",

"sortop": "n",

"hide": "n",

"checked": "y",

"allow_remark": "y",

"password": "",

"template": ""

},

{

"gid": 3,

"title": "告诉你C盘的每一个文件夹都是干嘛的(Win7版)",

"date": 1313210374,

"content": "<span>XP已经落伍。如果我没记错的话,XP是微软公司2001年10月25号发布的,十年了啊同志们!</span>

<p align="\\"right\""><span>JohnLV @USTB</span>
\r\n<span>2011年8月13日12:27:45</span>

",

"excerpt": "<span>XP已经落伍。如果我没记错的话,XP是微软公司2001年10月25号发布的,十年了啊同志们!</span>
\r\n<span>...</span>",

"alias": "",

"author": 1,

"sortid": 4,

"type": "blog",

"views": 2304,

"comnum": 0,

"attnum": 0,

"top": "n",

"sortop": "n",

"hide": "n",

"checked": "y",

"allow_remark": "y",

"password": "",

"template": ""

}

]

```


4. 第 2 篇文章

http://ooxx.com/content/plugins/json_api/tinylara/public/articles/2

返回值:

```json

{

"gid": 2,

"title": "Welcome To John·Lui's Personal Blog",

"date": 1323699410,

"content": "面朝大海,春暖花开",

"excerpt": "面朝大海,春暖花开",

"alias": "",

"author": 1,

"sortid": 4,

"type": "blog",

"views": 2129,

"comnum": 0,

"attnum": 0,

"top": "n",

"sortop": "n",

"hide": "n",

"checked": "y",

"allow_remark": "y",

"password": "",

"template": ""

}

```