Skip to content

Commit

Permalink
Indicate whether like amount is hidden for Instagram posts
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Feb 4, 2025
1 parent 3c62f37 commit 79cb297
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datasources/instagram/search_instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def parse_graph_item(node):
"hashtags": ",".join(re.findall(r"#([^\s!@#$%ˆ&*()_+{}:\"|<>?\[\];'\,./`~']+)", caption)),
# "usertags": ",".join(
# [u["node"]["user"]["username"] for u in node["edge_media_to_tagged_user"]["edges"]]),
"num_likes": node["edge_media_preview_like"]["count"],
"likes_hidden": "yes" if no_likes else "no",
"num_likes": node["edge_media_preview_like"]["count"] if not no_likes else MissingMappedField(0),
"num_comments": node.get("edge_media_preview_comment", {}).get("count", 0),
"num_media": num_media,
"location_name": location["name"],
Expand Down Expand Up @@ -239,7 +240,8 @@ def parse_itemlist_item(node):
"hashtags": ",".join(re.findall(r"#([^\s!@#$%ˆ&*()_+{}:\"|<>?\[\];'\,./`~']+)", caption)),
# "usertags": ",".join(
# [u["node"]["user"]["username"] for u in node["edge_media_to_tagged_user"]["edges"]]),
"num_likes": node["like_count"],
"likes_hidden": "yes" if no_likes else "no",
"num_likes": node["like_count"] if not no_likes else MissingMappedField(0),
"num_comments": num_comments,
"num_media": num_media,
"location_name": location["name"],
Expand Down

0 comments on commit 79cb297

Please sign in to comment.