Skip to content

Commit

Permalink
Updated Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
davidteather committed Sep 14, 2019
1 parent 882415c commit 04926a5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 135 deletions.
1 change: 0 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
setup.cfg
setup.py
TikTokApi\__init__.py
TikTokApi\getTrending.py
TikTokApi\tiktok.py
1 change: 0 additions & 1 deletion build/lib/TikTokApi/__init__.py

This file was deleted.

119 changes: 0 additions & 119 deletions build/lib/TikTokApi/tiktok.py

This file was deleted.

14 changes: 6 additions & 8 deletions examples/getAUsersVideos.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# NOTE: This python file cannot be run from the examples folder.
# It MUST BE in the same directory as tiktok.py is located!
# Yeah sorry, it's kind of annoying, but it's more organized this way.
from TikTokApi import TikTokapi

# Starts T
# Starts The Api Class
api = TikTokapi("browsermob-proxy/bin/browsermob-proxy")

# The Number of trending TikToks you want to be displayed
results = 10
trending = api.trending(results)

for tiktok in trending:
# Prints the music play URL for the tiktok in trending
print(tiktok['musicInfos']['playUrl'][0])
# The TikTok user's ID, can be found in the JSON from trending
id = "7119601"

trending = api.userPosts(id, count=results)

for tiktok in trending:
# Prints the text of the tiktok
print(tiktok['itemInfos']['text'])

Expand Down
7 changes: 2 additions & 5 deletions examples/getTrending.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# NOTE: This python file cannot be run from the examples folder.
# It MUST BE in the same directory as tiktok.py is located!
# Yeah sorry, it's kind of annoying, but it's more organized this way.
from tiktok import TikTokapi
from TikTokApi import TikTokapi

# Starts T
api = TikTokapi()
api = TikTokapi("path/to/browsermob-proxy")

# The Number of trending TikToks you want to be displayed
results = 10
trending = api.trending(results)

for tiktok in trending:
# Prints the music play URL for the tiktok in trending
print(tiktok['musicInfos']['playUrl'][0])

# Prints the text of the tiktok
print(tiktok['itemInfos']['text'])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
setup(
name = 'TikTokApi',
packages = ['TikTokApi'],
version = '2.1.2.1',
version = '2.1.3',
license='MIT',
description = 'The Unoffical TikTok API Wrapper in Python 3.',
author = 'David Teather',
Expand Down

0 comments on commit 04926a5

Please sign in to comment.