9b395f5cc3
Build Chrome Extension / build (push) Waiting to run
Trigger Website Rebuild (Docs Updated) / dispatch (push) Waiting to run
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
33 lines
1.5 KiB
JavaScript
33 lines
1.5 KiB
JavaScript
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import { listRemoveUser } from './list-remove-core.js';
|
|
import {
|
|
parseBatchIntervalSeconds,
|
|
parseCommaSeparatedUsernames,
|
|
runListBatch,
|
|
} from './list-batch-utils.js';
|
|
|
|
const EXAMPLE = 'Example: opencli twitter list-remove-batch 123456789 "@alice,@bob" --interval 5';
|
|
|
|
cli({
|
|
site: 'twitter',
|
|
name: 'list-remove-batch',
|
|
access: 'write',
|
|
description: 'Remove multiple users from a Twitter/X list you own from a comma-separated username list',
|
|
domain: 'x.com',
|
|
strategy: Strategy.UI,
|
|
browser: true,
|
|
args: [
|
|
{ name: 'listId', positional: true, type: 'string', required: true, help: 'Numeric ID of the list you own (e.g. from `opencli twitter lists`)' },
|
|
{ name: 'usernames', positional: true, type: 'string', required: true, help: 'Comma-separated Twitter/X handles to remove (with or without @)' },
|
|
{ name: 'interval', type: 'int', default: 5, help: 'Seconds to wait between account removals (default: 5)' },
|
|
{ name: 'timeout', type: 'int', default: 600, help: 'Max seconds for the overall batch command (default: 600)' },
|
|
],
|
|
columns: ['listId', 'username', 'userId', 'status', 'message'],
|
|
func: async (page, kwargs) => {
|
|
const listId = String(kwargs.listId || '').trim();
|
|
const usernames = parseCommaSeparatedUsernames(kwargs.usernames, EXAMPLE);
|
|
const interval = parseBatchIntervalSeconds(kwargs.interval);
|
|
return runListBatch({ page, listId, usernames, interval, operation: listRemoveUser });
|
|
},
|
|
});
|