个人api:hitokoto

来自Jimmy's Wiki
跳到导航 跳到搜索

hitokoto

A simple PHP hitokoto api.

https://github.com/jimmypury/hitokoto

Port: https://api.jimmyho.net/hitokoto/

Feature

  • Customize ID.
  • JavaScript support.

Example

$id

Normal: Random ID

Option: $id_min ~ $id_max

Request URL: https://api.jimmyho.net/hitokoto/?id=1234

Request Method: GET

Respond: 恕我无礼,我觉得这世上唯一能够信任的人就是我自己。

(The id of this sentence is 1234.)

$encode

Normal: text

Option: javascript or js

Request URL: https://api.jimmyho.net/hitokoto/?encode=javascript

Request Method: GET

Respond: function jimmyhitokoto(){document.write("就算是对我抱有敌意的人,也是被某个人深爱着而降生在这个世界上的。");}

(You can use hitokoto like this: <script type="text/javascript" src="https://api.jimmyho.net/hitokoto/?encode=javascript%22></script><div id="jimmyhitokoto"><script>jimmyhitokoto()</script></div>)

Acknowledgement

https://github.com/kokororin/hitokoto

http://hitokoto.cn