Initial commit

This commit is contained in:
Joe
2026-06-26 14:12:10 +02:00
commit 12518b259c
5258 changed files with 732924 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
const { pool } = require('./src/db');
async function run() {
const days = await pool.query('SELECT DISTINCT DATE(crawled_at) as d FROM crawls ORDER BY d');
console.log('\n=== Unique crawl days ===');
for (const r of days.rows) console.log(' ', r.d);
// What the position-history query actually returns for Mr Q / Top10OnlineSlots
const pos = await pool.query(
'SELECT DISTINCT ON (DATE(c.crawled_at)) DATE(c.crawled_at)::text AS day, ca.position FROM crawls c JOIN casinos ca ON ca.crawl_id = c.id WHERE ca.casino_name = $1 AND c.site_name = $2 ORDER BY DATE(c.crawled_at), c.crawled_at ASC',
['Mr Q', 'Top10OnlineSlots']
);
console.log('\n=== Position history (current query) ===');
console.log('Records:', pos.rows.length);
for (const r of pos.rows) console.log(' Day:', r.day, '| Pos:', r.position);
await pool.end();
}
run();
process.on('exit', () => process.exit(0));