Skip to main content

I'm a daemon server that auto send message to your zhihu new followers.

Project description

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qqqfome-0.0.4.tar.gz (10.6 kB view details)

Uploaded Source

Built Distributions

qqqfome-0.0.4-py3.5.egg (28.3 kB view details)

Uploaded Source

qqqfome-0.0.4-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file qqqfome-0.0.4.tar.gz.

File metadata

  • Download URL: qqqfome-0.0.4.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for qqqfome-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4c8928a3bbb8f3840a1fb54fcc7201aa65adee5fb29e8f5ad18ecb8deb868aef
MD5 0d70193ea3bf4cf3ff3dfad56e6a2232
BLAKE2b-256 7bad7972aaeba9a5b19c3d7492cbb26f02b68f165e5a5834a2cdccc2096b22c6

See more details on using hashes here.

File details

Details for the file qqqfome-0.0.4-py3.5.egg.

File metadata

  • Download URL: qqqfome-0.0.4-py3.5.egg
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for qqqfome-0.0.4-py3.5.egg
Algorithm Hash digest
SHA256 9debb553ac8698642792c76da44f58de5e39edd11f11690fc38ac9ec7cf2d93c
MD5 e3297028ee50de26ec39fe4d4cbfa7af
BLAKE2b-256 832f3a4e8473942dea452b7366a0da4e33470043292856f04d5d4432e9b852b1

See more details on using hashes here.

File details

Details for the file qqqfome-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for qqqfome-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5eacc0f73efee345401459e54568cf1080a7e86b07bdb6e3ff52a1d952f2adb1
MD5 1cb405cf53f02e73372156f41905be19
BLAKE2b-256 7550fdf928e9b9264a7274b8e9f8a285ccee892a7da8d09df378b2be6ab8947c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page