Updated Ai to pull from facebook, added a loading SVG to make user wait for server too boot up, and added commands that can be used to start off the AI exstraction

This commit is contained in:
Ace
2026-06-24 17:17:38 +02:00
parent 8a6ad5c6c6
commit b245b352e7
7 changed files with 307 additions and 88 deletions
+21
View File
@@ -0,0 +1,21 @@
import asyncio, sys, logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(levelname)s] %(message)s')
sys.path.insert(0, '.')
from main import get_fb_cookies, scrape_facebook
async def test():
print('Step 1: get cookies')
cookies = await get_fb_cookies()
print(f'Got {len(cookies)} cookies')
if not cookies:
print('No cookies - will still try scrape')
print('Step 2: run scrape_facebook')
result = await scrape_facebook(force=True)
print(f'Result success={result["success"]} leads={len(result["leads"])} error={result.get("error")}')
if result.get('leads'):
for l in result['leads'][:3]:
print(f' - {l["title"][:100]}')
if result.get('error'):
print(f' Error: {result["error"]}')
asyncio.run(test())