GuglielmoTor commited on
Commit
dd06b11
·
verified ·
1 Parent(s): 2051c7a

Update Data_Fetching_and_Rendering.py

Browse files
Files changed (1) hide show
  1. Data_Fetching_and_Rendering.py +6 -0
Data_Fetching_and_Rendering.py CHANGED
@@ -8,6 +8,10 @@ from transformers import pipeline
8
  from sessions import create_session
9
  from error_handling import display_error
10
 
 
 
 
 
11
  API_V2_BASE = 'https://api.linkedin.com/v2'
12
  API_REST_BASE = "https://api.linkedin.com/rest"
13
 
@@ -171,7 +175,9 @@ def fetch_posts_and_stats(comm_client_id, community_token, count=10):
171
  "impressions": impressions, "engagement": f"{engagement:.2f}%",
172
  "sentiment": sentiment_info["sentiment"], "sentiment_percent": sentiment_info["percentage"]
173
  })
 
174
 
 
175
  return posts, org_name, sentiments
176
 
177
  def render_post_cards(posts, org_name):
 
8
  from sessions import create_session
9
  from error_handling import display_error
10
 
11
+ import logging
12
+
13
+ logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
14
+
15
  API_V2_BASE = 'https://api.linkedin.com/v2'
16
  API_REST_BASE = "https://api.linkedin.com/rest"
17
 
 
175
  "impressions": impressions, "engagement": f"{engagement:.2f}%",
176
  "sentiment": sentiment_info["sentiment"], "sentiment_percent": sentiment_info["percentage"]
177
  })
178
+ logging.info(f"Appended post data for {post_id}: Likes={likes}, Comments={comments_count}, Shares={shares}, Clicks={clicks}")
179
 
180
+
181
  return posts, org_name, sentiments
182
 
183
  def render_post_cards(posts, org_name):