Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Jan 2, 2023
1 parent bb141bb commit ef8a8c3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 17 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ asyncio.run(main())

## 客户名单

<details><summary>2022.12.31更新</summary>
<details><summary>2023.01.01更新</summary>

| 吧名 | 关注用户数 | 最近29天日均访问量 | 日均主题帖数 | 日均回复数 |
| :------------: | :--------: | :----------------: | :----------: | :--------: |
| 抗压背锅 | 4,454,586 | 975,040 | 1,606 | 66,824 |
| 孙笑川 | 3,097,910 | 697,083 | 5,990 | 186,948 |
| lol半价 | 1,991,113 | 75,799 | 203 | 3,008 |
| 宫漫 | 1,453,226 | 43,287 | 159 | 2,272 |
| 逆水寒ol | 743,405 | 28,332 | 103 | 1,859 |
| 新孙笑川 | 514,443 | 39,771 | 287 | 13,218 |
| vtuber | 220,351 | 10,427 | 57 | 691 |
| asoul | 156,027 | 10,726 | 80 | 478 |
| 嘉然 | 59,291 | 10,293 | 74 | 974 |
| 向晚 | 30,745 | 7,441 | 55 | 684 |
| 贝拉 | 21,767 | 6,727 | 31 | 459 |
| 乃琳 | 17,337 | 3,451 | 20 | 258 |
| vtuber自由讨论 | 17,174 | 3,952 | 2 | 35 |
| 抗压背锅 | 4,463,363 | 954,177 | 1,572 | 66,895 |
| 孙笑川 | 3,106,094 | 687,350 | 5,923 | 187,652 |
| lol半价 | 1,995,711 | 75,247 | 198 | 2,973 |
| 宫漫 | 1,458,464 | 42,852 | 157 | 2,227 |
| 逆水寒ol | 746,608 | 28,955 | 105 | 1,914 |
| 新孙笑川 | 518,742 | 39,955 | 287 | 13,274 |
| vtuber | 220,498 | 10,363 | 55 | 691 |
| asoul | 156,006 | 10,676 | 79 | 474 |
| 嘉然 | 59,315 | 10,223 | 73 | 972 |
| 向晚 | 30,739 | 7,425 | 55 | 687 |
| 贝拉 | 21,761 | 6,723 | 31 | 458 |
| 乃琳 | 17,329 | 3,462 | 21 | 257 |
| vtuber自由讨论 | 17,178 | 3,967 | 2 | 34 |

</details>
Empty file added aiotieba/py.typed
Empty file.
38 changes: 35 additions & 3 deletions docs/tutorial/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@

`pid`是一个`uint64`

在贴吧混乱的字段命名中,它在某些场合下会被命名为`post_id`

This comment has been minimized.

Copy link
@n0099

n0099 Jan 2, 2023

p本就是post的缩写
贴吧泰国第几的en水平指导下的内部命名是

  • 吧forum
  • 主题帖thread
  • 回复贴post
  • 楼中楼subpost(考虑到13年10月才引入楼中楼叫subpost也不奇怪)

让我想起了flarum把主题帖叫discussion,phpbb的主题帖叫topic,而两者的回复贴都叫post

而tbm的命名是:

  • 吧forum
  • 对以下3种帖子的统称post(可以用来命名抽象类)
  • 主题帖thread
  • 回复贴reply
  • 楼中楼subreply


## 入门案例

Expand Down Expand Up @@ -166,7 +164,7 @@ asyncio.run(main())
BDUSS = "2dNNk1wMXVSZmw2MnpkWDNqMnM4MmFaeFZYNVVPUEhPS0thNFZzUERjME52V1KpSVFBQUFBJCQAAAAAAQAAAAEAAAA0lUwndl9ndWFyZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0wPmINMD5iY" # 把你的那一串长长的BDUSS放在这
```

然后复制下列代码并运行
运行下列代码

```python
import asyncio
Expand Down Expand Up @@ -211,3 +209,37 @@ asyncio.run(main())
```log
<2023-01-01 00:04:23.642> [INFO] [main] 当前用户信息: {'user_id': 957339815, 'user_name': 'Starry_OvO', 'portrait': 'tb.1.8277e641.gUE2cTq4A4z5fi2EHn5k3Q', 'nick_name': 'ºStarry'}
```

## 多账号

`aiotieba.toml`中添加一个新账户,例如:

```toml
[User]

[User.default]
BDUSS = "..."

[User.anotherKey]
BDUSS = "..."
```

然后你就可以通过输入不同的`BDUSS_key`来使用不同的账号

```python
import asyncio

import aiotieba as tb


async def main():
async with tb.Client("default") as client:
user = await client.get_self_info()
tb.LOG.info(f"当前用户信息: {user!r}")
async with tb.Client("anotherKey") as client:
user = await client.get_self_info()
tb.LOG.info(f"当前用户信息: {user!r}")


asyncio.run(main())
```

0 comments on commit ef8a8c3

Please sign in to comment.