Skip to main content
# Thank you follow me - 谢谢你关注我呀!

## 简介

这是一个用于自动给知乎里你的新关注者发送一条信息的后台服务。

技术栈什么的非常简单:

- 以前写的 `zhihu-py3` 用于获取知乎信息
- 用 `sqlite` 数据库保存老的关注者
- `daemon.py` 用于在 *unix 环境下创建 daemon proc

## 使用

### 安装

```bash
sudo python3 install qqqfome
```

### 创建工作目录

```bash
cd /path/that/you/want
mkdir qqqfome_work
cd qqqfome_work
```

### 初始化数据库

```bash
qqqfome -v init
```

然后根据提示登录知乎。

过程中需要验证码……如果你是在VPS上部署的话,你得想办法把 `captcha.gif` 文件从远程服务器弄到本地来查看验证码……

其实我更建议在本地用 `zhihu-py3` 生成 cookies 再弄到 VPS 上,这样就可以使用:

```bash
qqqfome -c /path/to/cookie -v init
```

来省略登录步骤。

如果一切正常的话,你会得到一个 sqlite 数据库文件。名字是 `<your-zhihu-id>.sqlite3`

### 启动

```bash
qqqfome -m $'I\'m {my_name}:\nThank you follow me.' -d start <your-zhihu-id>.sqlite3
```

(如果只是测试的话,可以去掉 `-d` 参数,让他在前台模式运行。)

`-m` 参数后跟需要发送的信息。注意,如果你在消息内部使用了转义字符,那么单引号前的`$`符号是必需的。

或者你可以将信息写在一个文件里,然后使用 `-M` 参数指定此文件。

两个都没有指定的话,默认的消息是:

```text
你好{your_name},我是{my_name},谢谢你关注我,你是我的第{follower_num}号关注者哟!

本消息由qqqfome项目自动发送。
项目地址:https://github.com/7sDream/qqqfome
{now}
```

程序支持的也就是例子里的这几个宏了……

## 查看Log

```bash
tail -f <your-zhihu-id>.sqlite3.log
```

默认的 log 文件名是 `<your-zhihu-id>.sqlite3.log`

还有一个是 `<your-zhihu-id>.sqlite3.pid` 这个文件不要删。

### 停止

如果不是后台模式,`Ctrl-C` 即可停止。

如果是 Daemon 模式,则:

```bash
qqqfome stop <sqlite_file_name>
```

## 文档

还没写,暂时用 `qqqfome -h` 凑合看吧。

```text
usage: qqqfome [-h] [-v] [-c FILE] [-p FILE] [-l FILE] [-t INTERVAL]
[-m MESSAGE | -M FILE] [-s NUM] [-d]
{init,start,stop} [file]

Thank-you-follow-me cli.

positional arguments:
{init,start,stop} command that you want exec
file database file that you want run on.

optional arguments:
-h, --help show this help message and exit
-v, --verbose turn on this to print info
-c FILE, --cookies FILE
provide cookies file if you have to skip login
-p FILE, --pid-file FILE
pid file location
-l FILE, --log-file FILE
log file location
-t INTERVAL, --time INTERVAL
set the interval time
-m MESSAGE, --message MESSAGE
the message that you want to send to your new follower
-M FILE, --message-file FILE
the message that you want to send to your new follower
-s NUM, --stop-at NUM
found NUM continuously old followers will stop pass
-d, --daemon work in daemon mode
```

## TODO

- 增加 update 命令,用于更新数据库里的 cookies
- 选项 `--mc` 或者类似的东西,用于随机从文件中选取一段文本(一行,或者以特定分隔符分隔的一段)用作 message。
- 写个教程
- 完善 readme 和 文档
- 重构代码
- 写测试

## LICENSEE

MIT.

Metadata

Release files for qqqfome 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qqqfome 0.0.4
File Size Uploaded Provenance
qqqfome-0.0.4.tar.gz 10.6 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for qqqfome 0.0.4
File Interpreter ABI Platform
qqqfome-0.0.4-py3.5.egg Legacy Egg format - - Details
qqqfome-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 55.6 kB

Release files / qqqfome-0.0.4.tar.gz

Download URL qqqfome-0.0.4.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4c8928a3bbb8f3840a1fb54fcc7201aa65adee5fb29e8f5ad18ecb8deb868aef
BLAKE2b-256 checksum
How to use checksums
7bad7972aaeba9a5b19c3d7492cbb26f02b68f165e5a5834a2cdccc2096b22c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / qqqfome-0.0.4-py3.5.egg

Download URL qqqfome-0.0.4-py3.5.egg
Size 28.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
9debb553ac8698642792c76da44f58de5e39edd11f11690fc38ac9ec7cf2d93c
BLAKE2b-256 checksum
How to use checksums
832f3a4e8473942dea452b7366a0da4e33470043292856f04d5d4432e9b852b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / qqqfome-0.0.4-py3-none-any.whl

Download URL qqqfome-0.0.4-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eacc0f73efee345401459e54568cf1080a7e86b07bdb6e3ff52a1d952f2adb1
BLAKE2b-256 checksum
How to use checksums
7550fdf928e9b9264a7274b8e9f8a285ccee892a7da8d09df378b2be6ab8947c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for qqqfome 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page