微信好友数据可视化

Python May 6, 2021
yangxuanxc/wechat_friends
微信好友信息分析并可视化以及自动回复微信消息. Contribute to yangxuanxc/wechat_friends development by creating an account on GitHub.

突发奇想,想要研究一下自己的微信朋友列表,在 GitHub 上找了一圈,还真的有类似的项目。链接如上。虽然项目已经三年没有更新了,但是稍加修改,依然可以使用。

好友性别统计
好友地图
个性签名词云
好友图像拼接大图

(注:以上例子均引用自项目的 README )

使用方法

  1. 安装依赖包
pip3 install pillow
pip3 install pyecharts==0.5.11
pip3 install itchat
pip3 install jieba

pip3 install echarts-china-provinces-pypkg
pip3 install echarts-countries-pypkg

2. 修改 get_user_info.py 中的第 70 行为自己的微信昵称

3. 运行get_user_info.py,扫码后等待程序获取到好友信息及头像,待脚本输出文字后便可关闭

4. 运行 analyse.py,将会在 analyse/ 目录中生成结果。

一些问题

在生成好友个性签名统计时,会将表情符号也统计在内。此时可以使用正则表达式过滤掉 html 标签。如果使用 vim 编辑器,可用下方的命令去处理。

:%s/<\_.\{-1,\}>//g

参考资料

  1. https://github.com/yangxuanxc/wechat_friends
  2. https://github.com/yangxuanxc/wechat_friends/issues/34
  3. https://aftnn.org/post/47880443079/strip-tags-in-a-vim-buffer

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.