GuglielmoTor commited on
Commit
e06a10d
·
verified ·
1 Parent(s): 75a5661

Update Linkedin_Data_API_Calls.py

Browse files
Files changed (1) hide show
  1. Linkedin_Data_API_Calls.py +2 -2
Linkedin_Data_API_Calls.py CHANGED
@@ -115,8 +115,8 @@ def fetch_linkedin_posts_core(comm_client_id, community_token, org_urn, count=20
115
  "published_at_iso": published_at_iso,
116
  # These are placeholders for actual fields from LinkedIn API response. Verify field names.
117
  "author_urn": p.get("author", "urn:li:unknown"), # e.g., "urn:li:person:xxxx" or "urn:li:organization:xxxx"
118
- "is_ad": p.get("isSponsored", False), # LinkedIn might use a different field like 'sponsored' or 'promoted'
119
- "media_type": p.get("mediaCategory", "NONE") # e.g., ARTICLE, IMAGE, VIDEO, NONE
120
  })
121
  logging.info(f"Processed {len(processed_raw_posts)} posts with core data.")
122
  return processed_raw_posts, stats_map, org_name
 
115
  "published_at_iso": published_at_iso,
116
  # These are placeholders for actual fields from LinkedIn API response. Verify field names.
117
  "author_urn": p.get("author", "urn:li:unknown"), # e.g., "urn:li:person:xxxx" or "urn:li:organization:xxxx"
118
+ "is_ad": p.get("is_ad", False) # LinkedIn might use a different field like 'sponsored' or 'promoted'
119
+ #"media_type": p.get("mediaCategory", "NONE") # e.g., ARTICLE, IMAGE, VIDEO, NONE
120
  })
121
  logging.info(f"Processed {len(processed_raw_posts)} posts with core data.")
122
  return processed_raw_posts, stats_map, org_name