jonathanjordan21 commited on
Commit
5ea408d
·
verified ·
1 Parent(s): f48a877

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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"][0]
 
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: