diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1ce90c3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +node_modules +dist +.git +.env +.env.local +*.log +npm-debug.log* +.DS_Store +.vscode +.idea +*.zip +*.tar.gz +dxspider-proxy/node_modules +iturhfprop-service/node_modules diff --git a/server.js b/server.js index 213b9d0..008ca99 100644 --- a/server.js +++ b/server.js @@ -703,6 +703,76 @@ app.get('/api/noaa/aurora', async (req, res) => { } }); +// DX News from dxnews.com +let dxNewsCache = { data: null, timestamp: 0 }; +const DXNEWS_CACHE_TTL = 30 * 60 * 1000; // 30 minutes + +app.get('/api/dxnews', async (req, res) => { + try { + if (dxNewsCache.data && (Date.now() - dxNewsCache.timestamp) < DXNEWS_CACHE_TTL) { + return res.json(dxNewsCache.data); + } + + const response = await fetch('https://dxnews.com/', { + headers: { 'User-Agent': 'OpenHamClock/1.0 (amateur radio dashboard)' } + }); + const html = await response.text(); + + // Parse news items from HTML + const items = []; + // Match pattern: