Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
复制神评的实验
daoyianc54b869e8d35
diff --git a/electron/main/interaction/controller.ts b/electron/main/interaction/controller.tsindex df6094b2..28c4ac16 100644--- a/electron/main/interaction/controller.ts+++ b/electron/main/interaction/controller.ts@@ -77,6 +77,7 @@ export class InteractionController {likeProb?: any; // 点赞概率collectProb?: any; // 收藏概率commentProb?: any; // 评论概率+ commentType: any; // 评论类型},): Promise<any> {const account = await this.accountService.getAccountById(accountId);diff --git a/electron/main/interaction/service.ts b/electron/main/interaction/service.tsindex 12dd7ddf..cccabf30 100644--- a/electron/main/interaction/service.ts+++ b/electron/main/interaction/service.ts@@ -23,6 +23,7 @@ import { WorkData } from '../plat/plat.type';import { AutoInteractionCache } from './cacheData';import { backPageData, CorrectQuery } from '../../global/table';import { AccountType } from '../../../commont/AccountEnum';+// import { ReplyController } from '../reply/controller';@Injectable()export class InteractionService {@@ -118,6 +119,7 @@ export class InteractionService {likeProb?: any; // 点赞概率collectProb?: any; // 收藏概率commentProb?: any; // 评论概率+ commentType: any; // 评论类型},scheduleEvent: (data: {tag: AutorWorksInteractionScheduleEvent;@@ -150,7 +152,7 @@ export class InteractionService {// 1. 循环AI回复评论for (const works of worksList) {- console.log('------ 开始处理作品:', works.dataId);+ console.log('------ 开始处理作品:', works);sleep(5);const oldRecord = await this.getInteractionRecord(userInfo.id,@@ -159,8 +161,8 @@ export class InteractionService {);if (oldRecord) continue;- console.log('option.commentContent', option);- if (!option.commentContent) {+ // console.log('option.commentContent', option);+ if (option.commentType && option.commentType == 'ai') {const aiRes = await toolsApi.aiRecoverReview({content: (works.desc || '') + (works.title || ''),});@@ -179,6 +181,31 @@ export class InteractionService {option.commentContent = aiRes;}++ if (option.commentType && option.commentType == 'copy') {+ const commentList = await platController.getCommentList(+ account,+ {+ dataId: works.dataId,+ option: {+ xsec_token: works.data?.xsec_token || '',+ },+ },+ '0',+ );++ // console.log('------ commentList', commentList);++ const randomIndex = Math.floor(+ Math.random() * commentList.list.length,+ );+ option.commentContent = commentList.list[randomIndex].content;++ // option.commentContent = aiRes;+ }+ console.log('------ option.commentContent', option.commentContent);+ // return;+scheduleEvent({tag: AutorWorksInteractionScheduleEvent.ReplyCommentStart,data: {diff --git a/src/views/replyother/replyother.tsx b/src/views/replyother/replyother.tsxindex 28572ef0..dff68aa2 100644--- a/src/views/replyother/replyother.tsx+++ b/src/views/replyother/replyother.tsx@@ -52,6 +52,7 @@ import {QuestionCircleOutlined,SyncOutlined,CheckSquareOutlined,+ CopyOutlined,} from '@ant-design/icons';import Masonry from 'react-masonry-css';import { AccountModel } from '../../../electron/db/models/account';@@ -209,7 +210,7 @@ export default function Page() {// 添加任务表单相关状态const [taskForm] = Form.useForm();- const [commentType, setCommentType] = useState<'ai' | 'custom'>('ai');+ const [commentType, setCommentType] = useState<'ai' | 'custom' | 'copy' >('ai');const [customComments, setCustomComments] = useState<string[]>(['很棒!','喜欢这个',@@ -310,7 +311,9 @@ export default function Page() {// 调用icpCreateInteractionOneKey函数const option: any = {platform: activeAccountType,+ commentType: values.commentType,...values,+ accountId: activeAccountId};if (values.commentType != 'ai') {option.commentContent = customComments.join(',');@@ -1923,6 +1926,11 @@ export default function Page() {<RobotOutlined /> Deepseek评论</Radio.Button></Tooltip>+ <Tooltip title="复制神评评论">+ <Radio.Button value="copy">+ <CopyOutlined /> 神评评论+ </Radio.Button>+ </Tooltip><Tooltip title="使用自定义评论"><Radio.Button value="custom"><UserOutlined /> 自定义评论