Yiyan mainly provides one sentence service for the website. We can use API to directly call any text display in the blog, and this site has also added yo, careful people can find~~~
Let's take an example: the text below the refresh page will appear randomly


: D Getting


How to use web page call:

 <p id="hitokoto">: D Getting</ p> <!--  Select one of the following writing methods --> <!--  Modern writing, recommended --> <!--  Compatible with lower version browsers (including IE), removable --> <script src=" https://cdn.jsdelivr.net/npm/bluebird @3/js/browser/bluebird.min.js"></script> <script src=" https://cdn.jsdelivr.net/npm/whatwg-fetch @2.0.3/fetch.min.js"></script> <!-- End--> <script> fetch(' https://v1.hitokoto.cn ') .then(function (res){ return res.json(); }) .then(function (data) { var hitokoto = document.getElementById('hitokoto'); hitokoto.innerText = data.hitokoto;  }) .catch(function (err) { console.error(err); }) </script> <!--  Old style writing, most worried about compatibility --> <script> var xhr = new XMLHttpRequest(); xhr.open('get', ' https://v1.hitokoto.cn '); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { var data = JSON.parse(xhr.responseText); var hitokoto = document.getElementById('hitokoto'); hitokoto.innerText = data.hitokoto; } } xhr.send(); </script> <!--  New API method, very simple --> <script src=" https://v1.hitokoto.cn/?encode=js&select=%23hitokoto " defer></script>

Official API usage documents: https://hitokoto.cn/api