From d5dec99f3d99e8b63a8ac7ddd6e8a8808fd96d5a Mon Sep 17 00:00:00 2001 From: ez code ez life Date: Tue, 26 Apr 2022 18:00:35 +0200 Subject: [PATCH 1/4] add quickstart.py & more install instructions in readme --- README.md | 10 +++++++++- quickstart.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 quickstart.py diff --git a/README.md b/README.md index cf4c743..03fbb51 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ TikTokPy --- -## Quickstart +## Quickstart.py ```python import asyncio @@ -70,3 +70,11 @@ Install browser by playwright ```shell playwright install chromium ``` + +If you have little to no knowledge in programming: Read this Guide ["How to use TiktokPy Pyhton Bot"] for beginners(https://my-tailwind-nextjs-starter-blog.vercel.app/blog/how-to-use-tiktokpy-for-beginner-programmers-indepth-guide) + +## Run + +```shell +python quickstart.py +``` diff --git a/quickstart.py b/quickstart.py new file mode 100644 index 0000000..7e731d5 --- /dev/null +++ b/quickstart.py @@ -0,0 +1,35 @@ +import asyncio +from tiktokpy import TikTokPy + +async def main(): + async with TikTokPy() as bot: + # Do you want to get trending videos? You can! + trending_items = await bot.trending(amount=5) + + for item in trending_items: + # ❤️ you can like videos + await bot.like(item) + # or unlike them + await bot.unlike(item) + # or follow users + await bot.follow(item.author.username) + # as and unfollow + await bot.unfollow(item.author.username) + + # 😏 getting user's feed + user_feed_items = await bot.user_feed(username="justinbieber", amount=5) + + for item in user_feed_items: + # 🎧 get music title, cover, link, author name.. + print("Music title: ", item.music.title) + # #️⃣ print all tag's title of video + print([tag.title for tag in item.challenges]) + # 📈 check all video stats + print("Comments: ", item.stats.comments) + print("Plays: ", item.stats.plays) + print("Shares: ", item.stats.shares) + print("Likes: ", item.stats.likes) + + # and many other things 😉 + +asyncio.run(main()) \ No newline at end of file From e25d8fbd6c4e304fc03401617f2af0e1cece7605 Mon Sep 17 00:00:00 2001 From: ez code ez life Date: Tue, 26 Apr 2022 18:07:40 +0200 Subject: [PATCH 2/4] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03fbb51..6f012e4 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Install browser by playwright playwright install chromium ``` -If you have little to no knowledge in programming: Read this Guide ["How to use TiktokPy Pyhton Bot"] for beginners(https://my-tailwind-nextjs-starter-blog.vercel.app/blog/how-to-use-tiktokpy-for-beginner-programmers-indepth-guide) +If you have little to no knowledge in programming: Read this Guide ["How to use TiktokPy Pyhton Bot"](https://my-tailwind-nextjs-starter-blog.vercel.app/blog/how-to-use-tiktokpy-for-beginner-programmers-indepth-guide) for beginners ## Run From dacdcc5bcaca7526ffbff932caeb24b87f5af356 Mon Sep 17 00:00:00 2001 From: ez code ez life Date: Tue, 26 Apr 2022 18:09:24 +0200 Subject: [PATCH 3/4] fix another typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f012e4..043e39c 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,10 @@ Install browser by playwright playwright install chromium ``` -If you have little to no knowledge in programming: Read this Guide ["How to use TiktokPy Pyhton Bot"](https://my-tailwind-nextjs-starter-blog.vercel.app/blog/how-to-use-tiktokpy-for-beginner-programmers-indepth-guide) for beginners +If you have little to no knowledge in programming: Read this Guide ["How to use TiktokPy Python Bot"](https://my-tailwind-nextjs-starter-blog.vercel.app/blog/how-to-use-tiktokpy-for-beginner-programmers-indepth-guide) for beginners ## Run ```shell python quickstart.py -``` +``` \ No newline at end of file From f8fa0d5314c6942a71f18185b9cbac8b250004ba Mon Sep 17 00:00:00 2001 From: Evgeny Kemerov Date: Wed, 27 Apr 2022 13:20:05 +0300 Subject: [PATCH 4/4] Update quickstart.py --- quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstart.py b/quickstart.py index 7e731d5..8810b40 100644 --- a/quickstart.py +++ b/quickstart.py @@ -32,4 +32,4 @@ async def main(): # and many other things 😉 -asyncio.run(main()) \ No newline at end of file +asyncio.run(main())