Skip to content

中国古诗词版的Fortune。Chinese Ancient Poetry/Poem Fortune.

Notifications You must be signed in to change notification settings

shenyunhang/fortune-zh

Repository files navigation

fortune-zsh

中国古诗词版的fortune。

Chinese ancient poetry fortune.

古诗词数目:

先秦:654

两汉:207

魏晋:128

南北朝:216

隋代:16

唐代:47061

五代:153

宋代:21450

金朝:63

元代:1401

明代:298

清代:669

依赖

fortune

strfile(通常会和fortune一起安装)

sudo apt-get install fortunes

安装:

爬取最新古诗词并安装

  1. 克隆仓库
# Make sure to clone with --recursive
git clone --recursive https://github.com/shenyunhang/fortune-zh.git
  1. 爬取古诗文
cd fortune-zh
./gushiwen-crawler/start_crawler.sh
  1. 安装古诗文
./install.sh

快速安装

使用已经爬取下来的古诗文数据。

  1. 克隆仓库
git clone --recursive https://github.com/shenyunhang/fortune-zh-data.git
  1. 安装古诗文
cd fortune-zh-data
sudo cp * /usr/share/games/fortunes/

用法:

  1. 随机输出古诗文。
fortune -e 先秦 两汉 魏晋 南北朝 隋代 唐代 五代 宋代 金朝 元代 明代 清代
  1. 设置终端登陆显示。在shell配置文件的最后加入:  
fortune -e 先秦 两汉 魏晋 南北朝 隋代 唐代 五代 宋代 金朝 元代 明代 清代
echo ''

 登录效果图:
image image image

  1. 或者:
fortune -e 先秦 两汉 魏晋 南北朝 隋代 唐代 五代 宋代 金朝 元代 明代 清代 |cowsay
echo ''
  1. 或者:
fortune -e 先秦 两汉 魏晋 南北朝 隋代 唐代 五代 宋代 金朝 元代 明代 清代 |ponysay
echo ''

问题

如果安装后不能用,则先输入:

fortune -f

查看是否已经导入先秦、两汉、魏晋、南北朝、隋代、唐代、五代、宋代、金朝、元代、明代和清代的数据。

如果没有,则修改install.sh里的“FORTUNES”变量到对应的路径再安装。  

About

中国古诗词版的Fortune。Chinese Ancient Poetry/Poem Fortune.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •