Spaces:
Sleeping
Sleeping
| from services.youtube_analyzer import analyze_youtube | |
| from services.instagram_analyzer import analyze_instagram | |
| from services.linkedin_analyzer import analyze_linkedin | |
| from services.facebook_analyzer import analyze_facebook | |
| from services.twitter_analyzer import analyze_twitter | |
| from services.tiktok_analyzer import analyze_tiktok | |
| from services.pinterest_analyzer import analyze_pinterest | |
| from services.grammar_analyzer import analyze_grammar | |
| ANALYZERS = { | |
| "youtube": analyze_youtube, | |
| "instagram": analyze_instagram, | |
| "linkedin": analyze_linkedin, | |
| "facebook": analyze_facebook, | |
| "twitter": analyze_twitter, | |
| "tiktok": analyze_tiktok, | |
| "pinterest": analyze_pinterest, | |
| "grammar": analyze_grammar, | |
| } | |
| def analyze_batch(content: str, platforms: list[str]) -> dict: | |
| results = {} | |
| for p in platforms: | |
| fn = ANALYZERS.get(p) | |
| if fn: | |
| try: | |
| results[p] = fn(content) | |
| except Exception as e: | |
| results[p] = {"error": str(e)} | |
| return results | |