Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -306,7 +306,7 @@ async def fb_post_detail(username: Optional[str] = None, post_id: Optional[str]
|
|
306 |
splitter = '"comments":{"total_count":'
|
307 |
comments = script_tag.string.split(splitter, 2)[1].split("}")[0]
|
308 |
likes = [x.get("count") for x in reactions if x.get("name") == "like"]
|
309 |
-
likes = likes[0] if likes else
|
310 |
|
311 |
print(total_react, reactions, shares, comments, likes)
|
312 |
if '"message":{"text":"' in script_tag.string:
|
@@ -340,9 +340,9 @@ async def fb_post_detail(username: Optional[str] = None, post_id: Optional[str]
|
|
340 |
return {
|
341 |
"insights": {
|
342 |
"likeCount": likes,
|
343 |
-
"commentCount": comments,
|
344 |
-
"shareCount": shares,
|
345 |
-
"reactionCount": total_react,
|
346 |
"reactions": reactions,
|
347 |
},
|
348 |
"description": desc,
|
|
|
306 |
splitter = '"comments":{"total_count":'
|
307 |
comments = script_tag.string.split(splitter, 2)[1].split("}")[0]
|
308 |
likes = [x.get("count") for x in reactions if x.get("name") == "like"]
|
309 |
+
likes = likes[0] if likes else 0
|
310 |
|
311 |
print(total_react, reactions, shares, comments, likes)
|
312 |
if '"message":{"text":"' in script_tag.string:
|
|
|
340 |
return {
|
341 |
"insights": {
|
342 |
"likeCount": likes,
|
343 |
+
"commentCount": int(comments),
|
344 |
+
"shareCount": int(shares),
|
345 |
+
"reactionCount": int(total_react),
|
346 |
"reactions": reactions,
|
347 |
},
|
348 |
"description": desc,
|