|
@@ -328,8 +328,9 @@ function renderSentimentStats(series) {
|
|
|
|
|
|
|
|
// ── Entities ─────────────────────────────────────────────
|
|
// ── Entities ─────────────────────────────────────────────
|
|
|
async function loadEntities() {
|
|
async function loadEntities() {
|
|
|
|
|
+ var hours = ($('entity-hours') || {}).value || 24;
|
|
|
try {
|
|
try {
|
|
|
- var res = await fetch(API + '/entities?hours=144&limit=30');
|
|
|
|
|
|
|
+ var res = await fetch(API + '/entities?hours=' + hours + '&limit=30');
|
|
|
var d = await res.json();
|
|
var d = await res.json();
|
|
|
_entitiesData = d.entities || [];
|
|
_entitiesData = d.entities || [];
|
|
|
renderEntityList();
|
|
renderEntityList();
|
|
@@ -367,8 +368,9 @@ async function showEntityDetail(label) {
|
|
|
if (!label) return;
|
|
if (!label) return;
|
|
|
var el = $('entity-detail'); if (!el) return;
|
|
var el = $('entity-detail'); if (!el) return;
|
|
|
el.innerHTML = '<div class="loading">Fetching clusters mentioning ' + esc(label) + '...</div>';
|
|
el.innerHTML = '<div class="loading">Fetching clusters mentioning ' + esc(label) + '...</div>';
|
|
|
|
|
+ var hours = ($('entity-hours') || {}).value || 24;
|
|
|
try {
|
|
try {
|
|
|
- var res = await fetch(API + '/clusters?topic=all&hours=144&limit=100');
|
|
|
|
|
|
|
+ var res = await fetch(API + '/clusters?topic=all&hours=' + hours + '&limit=100');
|
|
|
var d = await res.json();
|
|
var d = await res.json();
|
|
|
var matched = (d.clusters || []).filter(function(c) {
|
|
var matched = (d.clusters || []).filter(function(c) {
|
|
|
return (c.entities||[]).some(function(e) { return (e||'').toLowerCase() === label.toLowerCase(); });
|
|
return (c.entities||[]).some(function(e) { return (e||'').toLowerCase() === label.toLowerCase(); });
|
|
@@ -397,8 +399,9 @@ async function showEntityDetail(label) {
|
|
|
var _keywordsData = [];
|
|
var _keywordsData = [];
|
|
|
|
|
|
|
|
async function loadKeywords() {
|
|
async function loadKeywords() {
|
|
|
|
|
+ var hours = ($('keyword-hours') || {}).value || 24;
|
|
|
try {
|
|
try {
|
|
|
- var res = await fetch(API + '/keywords?hours=144&limit=30');
|
|
|
|
|
|
|
+ var res = await fetch(API + '/keywords?hours=' + hours + '&limit=30');
|
|
|
var d = await res.json();
|
|
var d = await res.json();
|
|
|
_keywordsData = d.keywords || [];
|
|
_keywordsData = d.keywords || [];
|
|
|
renderKeywordList();
|
|
renderKeywordList();
|
|
@@ -436,8 +439,9 @@ async function showKeywordDetail(label) {
|
|
|
if (!label) return;
|
|
if (!label) return;
|
|
|
var el = $('keyword-detail'); if (!el) return;
|
|
var el = $('keyword-detail'); if (!el) return;
|
|
|
el.innerHTML = '<div class="loading">Fetching clusters with keyword ' + esc(label) + '…</div>';
|
|
el.innerHTML = '<div class="loading">Fetching clusters with keyword ' + esc(label) + '…</div>';
|
|
|
|
|
+ var hours = ($('keyword-hours') || {}).value || 24;
|
|
|
try {
|
|
try {
|
|
|
- var res = await fetch(API + '/clusters?topic=all&hours=144&limit=200');
|
|
|
|
|
|
|
+ var res = await fetch(API + '/clusters?topic=all&hours=' + hours + '&limit=200');
|
|
|
var d = await res.json();
|
|
var d = await res.json();
|
|
|
var matched = (d.clusters || []).filter(function(c) {
|
|
var matched = (d.clusters || []).filter(function(c) {
|
|
|
return (c.keywords||[]).some(function(k) { return (k||'').toLowerCase() === label.toLowerCase(); });
|
|
return (c.keywords||[]).some(function(k) { return (k||'').toLowerCase() === label.toLowerCase(); });
|