Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,20 +11,6 @@ from Bubble_API_Calls import fetch_linkedin_token_from_bubble
|
|
| 11 |
|
| 12 |
from Linkedin_Data_API_Calls import fetch_linkedin_posts, fetch_linkedin_comments, analyze_sentiment, prepare_data_for_bubble, bulk_upload_to_bubble
|
| 13 |
|
| 14 |
-
# Fetch data
|
| 15 |
-
posts = fetch_linkedin_posts(client_id, token_dict)
|
| 16 |
-
comments_data = fetch_linkedin_comments(client_id, token_dict, [post["id"] for post in posts])
|
| 17 |
-
sentiments = analyze_sentiment(comments_data)
|
| 18 |
-
|
| 19 |
-
# Prepare data
|
| 20 |
-
li_posts, li_post_stats, li_post_comments = prepare_data_for_bubble(posts, sentiments)
|
| 21 |
-
|
| 22 |
-
# Upload to Bubble
|
| 23 |
-
bulk_upload_to_bubble(li_posts, "LI_post")
|
| 24 |
-
bulk_upload_to_bubble(li_post_stats, "LI_post_stats")
|
| 25 |
-
bulk_upload_to_bubble(li_post_comments, "LI_post_comments")
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
def check_token_status(token_state):
|
| 30 |
return "✅ Token available" if token_state and token_state.get("token") else "❌ Token not available"
|
|
|
|
| 11 |
|
| 12 |
from Linkedin_Data_API_Calls import fetch_linkedin_posts, fetch_linkedin_comments, analyze_sentiment, prepare_data_for_bubble, bulk_upload_to_bubble
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def check_token_status(token_state):
|
| 16 |
return "✅ Token available" if token_state and token_state.get("token") else "❌ Token not available"
|