hot.js
1 import { cli, Strategy } from '@jackwener/opencli/registry'; 2 import { buildLinuxDoCompatFooter, executeLinuxDoFeed } from './feed.js'; 3 cli({ 4 site: 'linux-do', 5 name: 'hot', 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 hot is kept for backward compatibility.', 12 replacedBy: 'opencli linux-do feed --view top --period <period>', 13 args: [ 14 { name: 'limit', type: 'int', default: 20, help: 'Number of items (per_page)' }, 15 { 16 name: 'period', 17 type: 'str', 18 default: 'weekly', 19 help: 'Time period', 20 choices: ['all', 'daily', 'weekly', 'monthly', 'quarterly', 'yearly'], 21 }, 22 ], 23 func: async (page, kwargs) => executeLinuxDoFeed(page, { ...kwargs, view: 'top' }), 24 footerExtra: () => buildLinuxDoCompatFooter('opencli linux-do feed --view top --period <period>'), 25 });