Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -242,7 +242,11 @@ async def fb_post_detail(username: Optional[str] = None, post_id: Optional[str]
|
|
242 |
post_id = url.split("/")[-1]
|
243 |
try:
|
244 |
post_details = requests.get(f"https://graph.facebook.com/v20.0/1066512588151225_{post_id}?fields=place,shares,targeting,updated_time,created_time,description,child_attachments,caption,event,message,message_tags,story,status_type,source,coordinates,backdated_time,story_tags,scheduled_publish_time,properties,attachments&access_token={api_access_key}").json()
|
245 |
-
|
|
|
|
|
|
|
|
|
246 |
except Exception as e:
|
247 |
print(e)
|
248 |
|
|
|
242 |
post_id = url.split("/")[-1]
|
243 |
try:
|
244 |
post_details = requests.get(f"https://graph.facebook.com/v20.0/1066512588151225_{post_id}?fields=place,shares,targeting,updated_time,created_time,description,child_attachments,caption,event,message,message_tags,story,status_type,source,coordinates,backdated_time,story_tags,scheduled_publish_time,properties,attachments&access_token={api_access_key}").json()
|
245 |
+
if post_details.get("updated_date"):
|
246 |
+
date = post_details.get("updated_date")
|
247 |
+
else:
|
248 |
+
date = post_details.get("created_date")
|
249 |
+
|
250 |
except Exception as e:
|
251 |
print(e)
|
252 |
|