Update README
This commit is contained in:
parent
7cdff31ec3
commit
01dc1709c4
21
README.md
21
README.md
@@ -15,12 +15,12 @@ Other features:
|
|||||||
instead of web scraping.
|
instead of web scraping.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
```
|
```python
|
||||||
pip install pytchat
|
pip install pytchat
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```
|
```python
|
||||||
from pytchat import LiveChat
|
from pytchat import LiveChat
|
||||||
|
|
||||||
chat = LiveChat("G1w62uEMZ74")
|
chat = LiveChat("G1w62uEMZ74")
|
||||||
@@ -31,12 +31,13 @@ while chat.is_alive():
|
|||||||
data.tick()
|
data.tick()
|
||||||
```
|
```
|
||||||
|
|
||||||
callback mode
|
###callback mode
|
||||||
```
|
```python
|
||||||
from pytchat import LiveChat
|
from pytchat import LiveChat
|
||||||
|
|
||||||
chat = LiveChat("G1w62uEMZ74", callback = func)
|
chat = LiveChat("G1w62uEMZ74", callback = func)
|
||||||
while chat.is_alive():
|
while chat.is_alive():
|
||||||
|
#other background operation here.
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
def func(chatdata):
|
def func(chatdata):
|
||||||
@@ -45,8 +46,8 @@ def func(chatdata):
|
|||||||
chat.tick()
|
chat.tick()
|
||||||
```
|
```
|
||||||
|
|
||||||
asyncio context:
|
###asyncio context:
|
||||||
```
|
```python
|
||||||
from pytchat import LiveChatAsync
|
from pytchat import LiveChatAsync
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
@@ -66,8 +67,8 @@ loop.run_until_complete(main())
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
yt api compatible processor:
|
###yt api compatible processor:
|
||||||
```
|
```python
|
||||||
from pytchat import LiveChat, CompatibleProcessor
|
from pytchat import LiveChat, CompatibleProcessor
|
||||||
|
|
||||||
chat = LiveChat("G1w62uEMZ74",
|
chat = LiveChat("G1w62uEMZ74",
|
||||||
@@ -194,4 +195,6 @@ Structure of author object.
|
|||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
[taizan-hokuto](https://github.com/taizan-hokuto)
|
[taizan-hokuto](https://github.com/taizan-hokuto)
|
||||||
|
|
||||||
|
[twitter:@taizan205](https://twitter.com/taizan205)
|
||||||
Reference in New Issue
Block a user