Skip to content

Commit

Permalink
docs: 更新 README 文件中的快速上手代码
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed Feb 18, 2024
1 parent b364de9 commit e68add0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 FHU-yezi
Copyright (c) 2024 FHU-yezi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,23 @@ pip install jkit --pre
```

```python
from asyncio import run as asyncio_run
import asyncio

from jkit import User


async def main() -> None:
user = User.from_url("https://www.jianshu.com/u/622a3993108c")
print(f"用户昵称:{await user.name}") # == (await user.info).name

info = await user.info
print(f"用户昵称:{info.name}")
print(
f"性别:{info.gender.value},会员等级:{info.membership_info.type.value}\n"
f"会员过期时间:{info.membership_info.expired_at}"
)


asyncio_run(main())

asyncio.run(main())
```

```
Expand Down

0 comments on commit e68add0

Please sign in to comment.