Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -223,7 +223,8 @@ async def fb_post_detail(username: Optional[str] = None, post_id: Optional[str]
|
|
223 |
shares = script_tag.string.split(splitter, 2)[1].split(",")[0]
|
224 |
splitter = '"comments":{"total_count":'
|
225 |
comments = script_tag.string.split(splitter, 2)[1].split("}")[0]
|
226 |
-
likes = [x.get("count") for x in reactions if x.get("name") == "like"]
|
|
|
227 |
|
228 |
print(total_react, reactions, shares, comments, likes)
|
229 |
if '"message":{"text":"' in script_tag.string:
|
|
|
223 |
shares = script_tag.string.split(splitter, 2)[1].split(",")[0]
|
224 |
splitter = '"comments":{"total_count":'
|
225 |
comments = script_tag.string.split(splitter, 2)[1].split("}")[0]
|
226 |
+
likes = [x.get("count") for x in reactions if x.get("name") == "like"]
|
227 |
+
likes = likes[0] if likes else "0"
|
228 |
|
229 |
print(total_react, reactions, shares, comments, likes)
|
230 |
if '"message":{"text":"' in script_tag.string:
|