Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuchunyang/shici
查看诗词的网页
https://github.com/xuchunyang/shici
Last synced: about 1 month ago
JSON representation
查看诗词的网页
- Host: GitHub
- URL: https://github.com/xuchunyang/shici
- Owner: xuchunyang
- Created: 2020-08-15T07:30:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-19T13:34:43.000Z (about 4 years ago)
- Last Synced: 2024-10-16T01:45:56.323Z (3 months ago)
- Language: HTML
- Homepage: https://shi-ci.vercel.app/
- Size: 77.1 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 诗 · 词
一个用来查看诗词的网页:
https://shi-ci.vercel.app/
![screen shot of the website](screenshot.png)
只支持「作者」+「标题」的精确匹配,且查看诗时需要用繁体,而查看词时需要用简体,上游 [chinese-poetry](https://github.com/chinese-poetry/chinese-poetry) 原始数据如此,本来想试试用 opencc 转换的,但安装出错,暂时放弃。
## Features
- 自动补全作者名、诗词名
## API
和上面网页一样,只支持「作者」+「标题」的精确匹配,URL 举例:
https://shi-ci.vercel.app/api/search?author=杜甫&title=春望
```
$ curl 'https://shi-ci.vercel.app/api/search?author=杜甫&title=春望'
{
"author": "杜甫",
"paragraphs": [
"國破山河在,城春草木深。",
"感時花濺淚,恨別鳥驚心。",
"烽火連三月,家書抵萬金。",
"白頭搔更短,渾欲不勝簪。"
],
"tags": [
"唐诗三百首",
"战争",
"忧国忧民",
"爱国",
"五言律诗",
"初中古诗",
"八年级上册(课内)",
"思乡",
"写鸟",
"鸟"
],
"title": "春望",
"id": "e9e6425c-6c14-4f69-8694-87a8b96a43de"
}
```获得随机一首诗词:
https://shi-ci.vercel.app/api/random
API 支持 CORS。
## 数据来源
https://github.com/chinese-poetry/chinese-poetry 中的「诗」和「词」。
## 网站托管
网站托管在 Vercel,使用它的 Serverless Function。数据库服务采用 MongoDB Atlas。这两项服务都是免费的。