Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,9 +14,7 @@ from gradio_utils import get_url_user_token
|
|
14 |
from Bubble_API_Calls import (
|
15 |
fetch_linkedin_token_from_bubble,
|
16 |
bulk_upload_to_bubble,
|
17 |
-
fetch_linkedin_posts_data_from_bubble
|
18 |
-
# You need to implement this function in Bubble_API_Calls.py:
|
19 |
-
fetch_linkedin_mentions_data_from_bubble
|
20 |
)
|
21 |
|
22 |
from Linkedin_Data_API_Calls import (
|
@@ -114,9 +112,9 @@ def process_and_store_bubble_token(url_user_token, org_urn, token_state):
|
|
114 |
# Fetch Mentions from Bubble
|
115 |
logging.info(f"Attempting to fetch mentions from Bubble for org_urn: {current_org_urn}")
|
116 |
try:
|
117 |
-
fetched_mentions_df, error_message_mentions =
|
118 |
new_state["bubble_mentions_df"] = pd.DataFrame() if error_message_mentions or fetched_mentions_df is None else fetched_mentions_df
|
119 |
-
if error_message_mentions: logging.warning(f"Error from
|
120 |
except Exception as e:
|
121 |
logging.error(f"❌ Error fetching mentions from Bubble: {e}.")
|
122 |
new_state["bubble_mentions_df"] = pd.DataFrame()
|
@@ -321,7 +319,7 @@ def guarded_fetch_posts_and_mentions(token_state):
|
|
321 |
try:
|
322 |
fetched_posts_df, _ = fetch_linkedin_posts_data_from_bubble(org_urn, "LI_posts")
|
323 |
token_state["bubble_posts_df"] = pd.DataFrame() if fetched_posts_df is None else fetched_posts_df
|
324 |
-
fetched_mentions_df, _ =
|
325 |
token_state["bubble_mentions_df"] = pd.DataFrame() if fetched_mentions_df is None else fetched_mentions_df
|
326 |
logging.info("Refreshed posts and mentions DataFrames in state from Bubble after sync.")
|
327 |
except Exception as e:
|
|
|
14 |
from Bubble_API_Calls import (
|
15 |
fetch_linkedin_token_from_bubble,
|
16 |
bulk_upload_to_bubble,
|
17 |
+
fetch_linkedin_posts_data_from_bubble
|
|
|
|
|
18 |
)
|
19 |
|
20 |
from Linkedin_Data_API_Calls import (
|
|
|
112 |
# Fetch Mentions from Bubble
|
113 |
logging.info(f"Attempting to fetch mentions from Bubble for org_urn: {current_org_urn}")
|
114 |
try:
|
115 |
+
fetched_mentions_df, error_message_mentions = fetch_linkedin_posts_data_from_bubble(current_org_urn, BUBBLE_MENTIONS_TABLE_NAME)
|
116 |
new_state["bubble_mentions_df"] = pd.DataFrame() if error_message_mentions or fetched_mentions_df is None else fetched_mentions_df
|
117 |
+
if error_message_mentions: logging.warning(f"Error from fetch_linkedin_posts_data_from_bubble: {error_message_mentions}.")
|
118 |
except Exception as e:
|
119 |
logging.error(f"❌ Error fetching mentions from Bubble: {e}.")
|
120 |
new_state["bubble_mentions_df"] = pd.DataFrame()
|
|
|
319 |
try:
|
320 |
fetched_posts_df, _ = fetch_linkedin_posts_data_from_bubble(org_urn, "LI_posts")
|
321 |
token_state["bubble_posts_df"] = pd.DataFrame() if fetched_posts_df is None else fetched_posts_df
|
322 |
+
fetched_mentions_df, _ = fetch_linkedin_posts_data_from_bubble(org_urn, BUBBLE_MENTIONS_TABLE_NAME)
|
323 |
token_state["bubble_mentions_df"] = pd.DataFrame() if fetched_mentions_df is None else fetched_mentions_df
|
324 |
logging.info("Refreshed posts and mentions DataFrames in state from Bubble after sync.")
|
325 |
except Exception as e:
|