juzibot / intern

0 stars 0 forks source link

基于TIKTOK的 Wechaty puppet 模块设计与实现 #3

Open hcfw007 opened 2 years ago

hcfw007 commented 2 years ago

背景信息

我们希望我们的产品句子秒回可以拥有更多接入IM的能力,而句子秒回是基于Wechaty而搭建起来的,因此首当其冲的是让Wechaty可以稳定接入更多的IM。 TIKTOK是世界范围内流行的短视频软件,但除了短视频之外,也具备了很强的社交属性,提供了包括单聊、群聊的社交功能。 为了使 Wechaty 用户也能使用TOKTOK收发消息,需要开发对应的 puppet 接入模块。

项目目标

在句子互动实习期间,希望能将完成以下目标:

项目要求

介绍本周的工作进度 梳理当前遇到问题难点(最好提前发好 issue,便于讨论) 工作期间的代码进展均需体现在 github 中(https://github.com/juzibot/wechaty-puppet-tiktok) 开发功能的 commit,参见 Git提交规范 问题点及解决方案的 issue

导师信息

姓名:王楠 手机号:18500946096 github:https://github.com/hcfw007

YuSihe88 commented 2 years ago

Context

Tiktok is a popular short video software all over the world, but in addition to short video, it also has strong social attributes and provides social functions including single chat and group chat. In order to enable wechaty users to send and receive messages using Tiktok, I will develop the corresponding puppet access module.

Goal

App Basic information

intelligent tiktok robot based on the platform of shaking table, providing an intelligent robot customer service system with sales, marketing and after-sale services. It helps the enterprise to get customers quickly, enhance user stickiness and improve transformation through intelligent dialogue, customer service system and data analysis. It covers education, retail, insurance and other industries.

YuSihe88 commented 2 years ago

[Try to build a wechaty-TIKTOK-puppet ](1)

Yu Sihe - work progress report of the first week in November Date:01/11/2021 - 05/11/2021

Results completed this week:

  1. Solve the problem of fixed domain name: specify the subdomain name with local tunnel to achieve the purpose of Intranet penetration
  2. Apply to the power of the tiktok development platform, get the necessary client secret and client key.
  3. Use postman to successfully monitor the event and return the random number required by the platform

Difficulties encountered this week and areas requiring cooperation:

  1. Tiktok can quickly resolve and return to the random number required by the platform, but it can not deploy URL successfully to webhook in the development platform.

Current solutions:

  1. Tiktok development platform negotiations
  2. Temporarily skip the event subscription and use the sandbox environment for interface call and function debugging
  3. Change an intranet penetration method and try to deploy webhook again

Development plan and expected results for next week

  1. Continue to look at the source code and learn to call the interface
  2. Obtain access in the sandbox environment access_Token and client_token
  3. Try to call an interface successfully
YuSihe88 commented 2 years ago

[Try to build a wechaty-TIKTOK-puppet ](2)

Yu Sihe - work progress report of the second week in November Date:08/11/2021 - 13/11/2021

Results completed this week

  1. Last week, I read the source code and sorted out the logical relationship: First, we need a webhook ➡️ Get an authorization code ➡️ Get a token ➡️ Get client_ token ➡️ Call detailed function permissions
  2. At present, a code scanning interface can be provided
  3. You can get a code field through the code

Problems encountered in current work:

  1. The current code scanning interface can only be provided in the form of URL address: The program provides a URL address for scanning the code. Users need to click this address to scan the code before logging in, instead of directly printing the required code to the terminal as in the previous project.
  2. Why is the content in the code that should theoretically be printed to the terminal not output to the terminal?
  3. Why does the exported code expire quickly?

Development plan and expected results for next week

  1. Obtain access token (1) Continue to look at the source code (at present, the logical probability is no problem) (2) Import the obtained code into access In token function
  2. Find out why the code will expire quickly
  3. Let the program output Tat where it should be
  4. Try to intercept the QR code and output it to the terminal
YuSihe88 commented 2 years ago

[Try to build a wechaty-TIKTOK-puppet ](3)

Yu Sihe - work progress report of the third week in November Date:15/11/2021 - 20/11/2021

Results completed this week

  1. Obtain access_ token
  2. Learn the express framework and successfully call an interface
  3. Record the prerequisites for successful operation of ngrok: start the service on port 3000 first, and then penetrate the intranet to generate the domain name
  4. Apply for an enterprise number permission

Difficulties encountered this week and areas requiring cooperation

  1. Why is the content in the code that should theoretically be printed to the terminal not output to the terminal?(resolved)
  2. Why does the exported code expire quickly?(resolved)
  3. The listen function could not be run successfully(resolved)
  4. Test whether the enterprise number can call the private mail interface(Solving)

Development plan and expected results for next week

  1. Post the initial defense blog in wechaty community
  2. Questions you may be asked when preparing your defense on Wednesday
  3. Make a defense video and publish it
  4. Complete the reply function and realize the dingdong function of the comment area
hcfw007 commented 2 years ago

Nice job making some progresses so far. I believe to really make this TikTok puppet useable, we could divide it into these sub-tasks.

  1. Achieve DingDong bot with TikTok Api
  2. Read Puppet-Mock code and try to integrate DingDong into it.
  3. (optional) base on that, implements room (group) control and message. (There is no room api in TikTok doc. I tried to consult the custom service but no result so far)

Although to achieve step 1 will be good enough for the mid-term defense presentation, I believe you should start to read Puppet-Mock code any time when you are free. It would help you better understanding wechaty.

YuSihe88 commented 2 years ago

Thank you very much for your guidance. At present, I have successfully completed the dingdong logic in the comment area. In addition, I will put your proposed planning into my schedule for next week

[Try to build a wechaty-TIKTOK-puppet ](4)

Yu Sihe - work progress report of the forth week in November Date:22/11/2021 - 26/11/2021

Work content last week

  1. Publish the initial reply blog in wechaty community
  2. Write the defense draft on Wednesday
  3. Prepare questions that may be asked during Wednesday's defense
  4. Make a defense video and upload it to Youtube
  5. Completed the dingdong logic in the comment area

Problems encountered in current work

  1. At present, it is uncertain whether the private message interface can be called with the sandbox environment
  2. Time is tight

Work plan and arrangement for this week

  1. Read Puppet-Mock code and try to integrate DingDong into it.
  2. Successfully call the private mail interface, and complete the dingdong logic
lijiarui commented 2 years ago

Looking forward to your blog being merged!

https://github.com/wechaty/wechaty.js.org/pull/1409

hcfw007 commented 2 years ago

I'd suggest you to focus on sandbox env private message sending and receiving. I can help you with puppet integration as I read through wechaty code recently.

YuSihe88 commented 2 years ago

@lijiarui Thank you very much for your encouragement. Now my blog has been merged successfully, and I will continue to output relevant content. Welcome your attention and guidance

@hcfw007 Thank you for your help and guidance! I will continue my efforts as you said!😊❤️

[Try to build a wechaty-TIKTOK-puppet ](5)

Yu Sihe - work progress report of the fifth week in November Date:29/11/2021 - 03/12/2021

Work content last week

  1. Edit and publish the blog
  2. Add videos and powerpoint to the blog
  3. try calling the send_message interface (still in progress)
  4. Make it clear that the private message interface cannot be called in a sandbox environment
  5. Apply for the IM right again
  6. negotiated with Tiktok development platform

Problems encountered in current work

  1. The interface for sending private messages has several conditions that have not been met
  2. There is no way to trigger the receive_msg event
  3. I've recently started looking at puppet code, but I feel it's a hassle and a waste of time to sift through it
  4. time is tight

Work plan and arrangement for this week

  1. Look at the code
  2. Continue to try to implement the private message function
  3. Continue to negotiate with Tiktok development platform and try to solve the above problems
YuSihe88 commented 2 years ago

[Try to build a wechaty-TIKTOK-puppet ](6)

Yu Sihe - work progress report of the first week in December Date:06/12/2021 - 10/12/2021

Work content last week

  1. Read the Puppet code and summarize the basic steps
  2. Applied for a new application and successfully applied for eight new data permissions and two video permissions
  3. Read developer documentation and negotiate with development platforms
  4. Define the authority and requirements of enterprise number

Problems encountered in current work

  1. Time is tight
  2. The application for Enterprise has not been completed yet.
  3. After the certification is completed, we need to apply for the application again (It takes time too)

Work plan and arrangement for this week

  1. Application for enterprise number and successful certification (cooperation from Marketing Department is required)
  2. Read puppet code and make explicit comments on each step
YuSihe88 commented 2 years ago

[Try to build a wechaty-TIKTOK-puppet ](7)

Yu Sihe - work progress report of the second week in December Date:13/12/2021 - 17/12/2021

Work content last week

  1. Read the Puppet code and summarize the basic steps
  2. Read the developer documentation and negotiate with the platform
  3. Application for enterprise number and successful certification (cooperation from Marketing Department is required)

Problems encountered in current work

  1. Now the enterprise number application has been completed, and it is going through the web application approval process, which has a long approval cycle

Work plan and arrangement for this week

  1. Write the defense paper for Wednesday
  2. Prepare questions that you may be asked during your presentation on Wednesday
  3. Make defense video and upload it to YouTube
  4. complete the dingdong logic in the private letter
  5. Try to insert logic into Puppet
YuSihe88 commented 2 years ago

[Try to build a wechaty-TIKTOK-puppet ](8)

Yu Sihe - work progress report of the third week in December Date:19/12/2021 - 24/12/2021

Work content last week

  1. Write the defense paper for Wednesday
  2. Prepare questions that you may be asked during your presentation on Wednesday
  3. Make defense video and upload it to YouTube

Problems encountered in current work

  1. Approval has been unsuccessful

Work plan and arrangement for this week

  1. Wait until the approval is successful
  2. Calling more Interfaces
  3. Implement current logic using more advanced techniques than polling