Skip to content

Commit 4df2676

Browse files
committedOct 30, 2024
extending checks to author stats
1 parent 8af2128 commit 4df2676

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎datamodel.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,12 @@ function parseTiktok (header, data) {
294294
}
295295

296296
authStats = 0;
297+
likes = 0;
298+
videos = 0;
297299
if ('authorStats' in row['data'] && row['data']["authorStats"] != undefined) {
298300
authStats = row['data']["authorStats"]["followerCount"];
301+
likes = row['data']["authorStats"]["diggCount"];
302+
videos = row['data']["authorStats"]["videoCount"]
299303
}
300304

301305
const rows = {
@@ -304,8 +308,8 @@ function parseTiktok (header, data) {
304308
"author": `"${user_nickname}"`,
305309
"author_full": `"${user_fullname}"`,
306310
"author_followers": authStats,
307-
"author_likes": row['data']["authorStats"]["diggCount"],
308-
"author_videos": row['data']["authorStats"]["videoCount"],
311+
"author_likes": likes,
312+
"author_videos": videos,
309313
"author_avatar": row['data']['author']["avatarThumb"],
310314
"body": `"${escapeHTML(row['data']["desc"])}"`,
311315
"timestamp": new Date(parseInt(row['data']["createTime"] *1000)).toDateString(),

0 commit comments

Comments
 (0)