WeChat年度聊天报告(思路)

所需准备

首先你需要 new() girlfriend

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

## 思路方法
首先先导出和某人的聊天记录,跨度选择一年,类型选择全部(含图片)



然后将导出的聊天记录入库



使用分词工具,将所有的聊天记录分词,再生成词云,即完成。



导出方法有以下:

[http://wxbackup.imxfd.com/](http://wxbackup.imxfd.com/)

[https://github.com/BlueMatthew/WechatExporter](https://github.com/BlueMatthew/WechatExporter)

[https://www.louyue.com/android-weixin.htm](https://www.louyue.com/android-weixin.htm)



引用:

[https://github.com/myth984/wechat-report](https://github.com/myth984/wechat-report)

内网搭建npm私服Verdaccio

写在前面

因为内外网物理隔离,无法使用 npm 命令安装各种包。

寻求答案,目前以下解决方案可以实现这项业务:

sinopia 已经不再维护,遇到问题可能无渠道解答;

cnpm 的实现略显复杂,可能不适用于轻度个人使用;

因此使用 verdaccio 不过 verdaccio 主要擅长发布私有 package,搭建私服 npm 只是它顺带的技能。

综上所述,正经的搭建 npm 仓库应该选择 cnpm 或 Nexus

部署过程

2.1 安装

因此你需要准备一台能上外网的电脑先部署好环境再回迁到内网即可。

键入npm install -g verdaccio完成安装,当然你得确保你的 nodejs 环境版本大于 12

2.2 配置

安装成功后键入verdaccio即可启动,启动成功查看 log 会声明配置文件存放哪个位置,后结束进程。

Windows:C:\Users\PC\AppData\Roaming\verdaccio\config.yaml
Linux:~/.config/verdaccio/config.yaml

接下来修改配置文件 config.yaml

1
2
3
4
5
6
7
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npm.taobao.org
timeout: 300ms
max_fails: 20
fail_timeout: 10m

即将 verdaccio 的上行链路改为国内 npm 源,设置成功重新键入verdaccio即可。

2.3 set registry

另起一个 bash 终端窗口,设置目前使用源为 vardaccio

1
2
3
4
5
6
7
# npm config
npm config set registry http://localhost:4873/
npm config get registry

# 或 nrm
nrm add localnpm http://localhost:4873/
nrm use localnpm

2.4 正式食用

测试对于现有包的安装是否正常,建立一个空项目,安装 fastclick 这个包食用下。

1
2
3
4
mkdir localnpm
cd localnpm
npm init -y
npm install fastclick

回去查看 verdaccio 进程会发觉:

1
2
3
4
5
6
http --> 304, req: 'GET https://registry.npm.taobao.org/fastclick' (streaming)
http --> 304, req: 'GET https://registry.npm.taobao.org/fastclick', bytes: 0/0
http --> 304, req: 'GET https://registry.npmjs.org/fastclick' (streaming)
http --> 304, req: 'GET https://registry.npmjs.org/fastclick', bytes: 0/0
http <-- 200, user: null(127.0.0.1), req: 'GET /fastclick', bytes: 0/1122
http <-- 200, user: null(127.0.0.1), req: 'GET /fastclick', bytes: 0/1122

其实它是去了淘宝源下载到本地,然后再从本地拿 fastclick 包,其路径为 npm install -> verdaccio -> taobaonpm

所以 verdaccio 会根据本地缓存情况,自动从淘宝源下载未缓存的包,提供给用户使用。

2.5 缓存结果

Windows:C:\Users\PC\AppData\Roaming\verdaccio\storage
Linux:~/.config/verdaccio/storage/

进一步打开子文件夹可以看到以各个包命名的文件夹,文件夹内包含.tgz 文件和 package.json 文件。其中.tgz 文件,视项目需要可以缓存多个版本,存在即为缓存成功。

2.6 内网迁移

内网没有 npm,是无法安装 verdaccio 的,只能移植。

内网先部署 node 环境,将外网机器的 npm、verdaccio 文件夹打包拷入内网,并放到相同的位置。

如果一切正常,可以在内网运行verdaccio

然后同样将 verdaccio 设为内网 npm 的 registry 最后即成功迁移使用。

接下来每次更新根据~/storage/修改时间降序,把文件夹复制粘贴回内网即可完成更新。

引用

内网搭建 npm 私服——Verdaccio

如何将 Verdaccio 设为服务

使用 verdaccio 搭建私有 npm 仓库及发包

使用 verdaccio 搭建离线库

写在最后

最急用可以考虑键入npm install -g selenium-webdriver从%appdata%\npm\node_modules\selenium-webdriver 下使用npm-pack-all(<font style="color:rgb(0, 0, 0);background-color:rgb(246, 246, 246);">npm install </font><font style="color:rgb(96, 125, 139);background-color:rgb(246, 246, 246);">-</font><font style="color:rgb(0, 0, 0);background-color:rgb(246, 246, 246);">g npm</font><font style="color:rgb(96, 125, 139);background-color:rgb(246, 246, 246);">-</font><font style="color:rgb(0, 0, 0);background-color:rgb(246, 246, 246);">pack</font><font style="color:rgb(96, 125, 139);background-color:rgb(246, 246, 246);">-</font><font style="color:rgb(0, 0, 0);background-color:rgb(246, 246, 246);">all</font>)打包 tgz 到离线环境 install 即可。