diff --git a/README.md b/README.md index eebcc8a..c023500 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ - pytchat ======= pytchat is a python library for fetching youtube live chat. ## Description -pytchat is a python library for fetching youtube live chat. +pytchat is a python library for fetching youtube live chat without using youtube api, Selenium or BeautifulSoup. Other features: @@ -15,12 +14,13 @@ Other features: instead of web scraping. ## Install -``` +```python pip install pytchat ``` ## Examples -``` +### on-demand mode +```python from pytchat import LiveChat chat = LiveChat("G1w62uEMZ74") @@ -31,12 +31,14 @@ while chat.is_alive(): data.tick() ``` -callback mode -``` +### callback mode +```python from pytchat import LiveChat +import time chat = LiveChat("G1w62uEMZ74", callback = func) while chat.is_alive(): + #other background operation here. time.sleep(3) def func(chatdata): @@ -45,8 +47,8 @@ def func(chatdata): chat.tick() ``` -asyncio context: -``` +### asyncio context: +```python from pytchat import LiveChatAsync import asyncio @@ -66,8 +68,8 @@ loop.run_until_complete(main()) ``` -yt api compatible processor: -``` +### yt api compatible processor: +```python from pytchat import LiveChat, CompatibleProcessor chat = LiveChat("G1w62uEMZ74", @@ -113,6 +115,11 @@ Structure of each item which got from items() function.