latest.js
1 import { cli, Strategy } from '@jackwener/opencli/registry'; 2 import { buildLinuxDoCompatFooter, executeLinuxDoFeed } from './feed.js'; 3 cli({ 4 site: 'linux-do', 5 name: 'latest', 6 description: 'linux.do 最新话题', 7 domain: 'linux.do', 8 strategy: Strategy.COOKIE, 9 browser: true, 10 columns: ['title', 'replies', 'created', 'likes', 'views', 'url'], 11 deprecated: 'opencli linux-do latest is kept for backward compatibility.', 12 replacedBy: 'opencli linux-do feed --view latest', 13 args: [ 14 { name: 'limit', type: 'int', default: 20, help: 'Number of items (per_page)' }, 15 ], 16 func: async (page, kwargs) => executeLinuxDoFeed(page, { ...kwargs, view: 'latest' }), 17 footerExtra: () => buildLinuxDoCompatFooter('opencli linux-do feed --view latest'), 18 });