tt-help-cli-ycl 1.3.64 → 1.3.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/attach.js +13 -1
- package/src/cli/config.js +46 -3
- package/src/cli/explore.js +22 -4
- package/src/cli/refresh.js +46 -13
- package/src/lib/args.js +11 -2
- package/src/lib/browser/cdp.js +12 -4
- package/src/lib/constants.js +37 -36
- package/src/lib/scrape.js +20 -4
- package/src/lib/tiktok-scraper.mjs +11 -5
- package/src/scraper/explore-core.js +43 -20
- package/src/watch/data-store.js +44 -0
- package/src/watch/public/app.js +202 -5
- package/src/watch/public/index.html +4 -6
- package/src/watch/public/style.css +88 -1
- package/src/watch/server.js +23 -0
package/src/watch/server.js
CHANGED
|
@@ -439,6 +439,29 @@ export function startWatchServer(dataAnchor, port = 3000, existingStore) {
|
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
+
const userLocationMatch = routePath.match(
|
|
443
|
+
/^\/api\/user-location\/([^/]+)$/,
|
|
444
|
+
);
|
|
445
|
+
if (req.method === "PUT" && userLocationMatch) {
|
|
446
|
+
const uniqueId = userLocationMatch[1];
|
|
447
|
+
try {
|
|
448
|
+
const body = await readBody(req);
|
|
449
|
+
const ret = store.updateUserLocation(uniqueId, body.location);
|
|
450
|
+
if (ret.error) {
|
|
451
|
+
sendJSON(res, 404, { error: ret.error });
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
const ts = new Date().toISOString().slice(11, 19);
|
|
455
|
+
console.error(
|
|
456
|
+
`[JOB ${ts}] USER-LOCATION: ${uniqueId} → ${body.location} (modifiedAt=${ret.modifiedAt})`,
|
|
457
|
+
);
|
|
458
|
+
sendJSON(res, 200, ret);
|
|
459
|
+
} catch (e) {
|
|
460
|
+
sendJSON(res, 400, { error: e.message });
|
|
461
|
+
}
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
|
|
442
465
|
if (req.method === "GET" && routePath === "/api/comment-tasks") {
|
|
443
466
|
const limit = parseInt(params.limit) || 1;
|
|
444
467
|
const tasks = store.getPendingCommentTasks(limit);
|