Skip to main content
Glama
josuekongolo

CompanyIQ MCP Server

by josuekongolo
test-browser-flow.js2.14 kB
import { BrowserScraper } from './build/scraper/browser_scraper.js'; import { readdirSync } from 'fs'; console.log('🧪 Testing Browser Scraper Complete Flow\n'); console.log('═'.repeat(60)); const OPENAI_API_KEY = process.env.OPENAI_API_KEY || "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"; async function testFlow() { try { const scraper = new BrowserScraper(OPENAI_API_KEY); console.log('\n🚀 Starting browser scraper for org 999059198...\n'); const results = await scraper.getAllFinancialYears('999059198'); console.log('\n═'.repeat(60)); console.log('📊 RESULTS RETURNED FROM SCRAPER'); console.log('═'.repeat(60)); console.log(`Total years: ${results.length}\n`); results.forEach(r => { console.log(`Year ${r.year}:`); console.log(` Revenue: ${r.revenue ? (r.revenue/1000000).toFixed(1) + 'M NOK' : 'null'}`); console.log(` Profit: ${r.profit ? (r.profit/1000000).toFixed(1) + 'M NOK' : 'null'}`); console.log(` Assets: ${r.assets ? (r.assets/1000000).toFixed(1) + 'M NOK' : 'null'}`); console.log(` Source: ${r.source}`); console.log(''); }); // Check what files were created console.log('═'.repeat(60)); console.log('📁 CHECKING FILE SYSTEM'); console.log('═'.repeat(60)); try { const pdfFiles = readdirSync('./data/pdfs/'); console.log(`\nPDFs in data/pdfs/: ${pdfFiles.length} files`); pdfFiles.forEach(f => console.log(` - ${f}`)); } catch (e) { console.log('\nNo PDFs found in data/pdfs/'); } try { const jsonFiles = readdirSync('./data/extracted/').filter(f => f.endsWith('.json')); console.log(`\nJSON files in data/extracted/: ${jsonFiles.length} files`); jsonFiles.forEach(f => console.log(` - ${f}`)); } catch (e) { console.log('\nNo JSON files found in data/extracted/'); } } catch (error) { console.error('\n❌ Test failed:', error.message); console.error(error.stack); } } testFlow();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/josuekongolo/companyiq-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server