Douyin seo source code development and deployment technology sharing (1)

Table of contents

Development overview

Self-developed developer introduction

Development requirements:

Technology Development Layout

Source code deployment and build sharing

Deployment environment construction

Code Development Example

sample request

Sample response:

Code demonstration sample


Development overview

Based on the demands of developers and related platform rules, the open platform provides two open modes: capability openness and industry openness.

Self-developed developer introduction

Self-developed developers refer to those who have their own self-operated business, or have a variety of franchise roles, and can provide complete technical solutions based on user needs.

Development requirements:

  1. Comply with the development specifications and technical requirements of the Douyin platform, such as development documents, SDK, etc.

  2. Technical requirements: master HTML, CSS, JavaScript, jQuery and other front-end technologies; master PHP or other back-end languages; master database-related knowledge; familiar with SEO optimization technology.

  3. Douyin SEO source code needs to consider page access speed and user experience, and needs to be optimized. For example: compress code, cache data, use CDN, etc.

  4. In terms of SEO optimization, it is necessary to consider keyword analysis, content optimization, website structure optimization, link building, etc. to improve the ranking of the website in search engines.

  5. Mastering the latest technologies and functions of the Douyin platform, such as small programs, Douyin ads, etc., can play a full role in SEO optimization.

Technology Development Layout

Through continuous technological innovation and user demand analysis, we will pay more attention to the personalized development of this set of short video matrix source code system. Currently, the basic functions covered in the market include video editing, binding publishing, smart reply, data statistics and other basic functions. In addition, we did a lot of optimization during development, such as server clustering, parallelization, 1080p resolution, etc., and developed it from the perspective of the market (Douyin applets, local life services, and opened up the layout and development of mobile terminals)

Source code deployment and build sharing

Compared with other systems, the difficulty in developing and deploying this system is mainly in the application of official application permissions on each platform. According to the editor, the number of places inside some permissions on the Douyin short video platform is currently full, and it is difficult for a smart woman to cook without rice.

Deployment environment construction

  1.  Install a Python interpreter on your cloud server. You can use the following command to check if Python is installed:

    python -V
    

    If Python is not installed, you can install it with the following command:

    sudo apt-get update
    sudo apt-get install python
    
  2. Install pip, the package manager for Python. You can use the following command to install:

    sudo apt-get install python-pip
    
  3. Install virtualenv, which is a virtual environment for Python. This will help you use different versions of Python on the same computer.

    pip install virtualenv
    
  4. Create a new virtual environment.

    virtualenv venv
    
  5. Activate the virtual environment.

    source venv/bin/activate
    
  6. Install required dependencies.

Code Development Example

Scenario: Trigger the bound onChange callback when the properties of the common object are changed;

Idea: There are two traps that can change properties, set and deleteProperty, and just call the onChange method in them

sample request

curl --location --request GET 'https://open.douyin.com/item/comment/list/?open_id=ba253642-0590-40bc-9bdf-9a1334b94059&cursor=0&count=10&item_id=@8hxdhauTCMppanGnM4ltGM780mDqPP+KPpR0qQOmLVAXb/T060zdRmYqig357zEBq6CZRp4NVe6qLIJW/V/x1w==&sort_type=time' \
--header 'access-token: act.1d1021d2aee3d41fee2d2add43456badMFZnrhFhfWotu3Ecuiuka27L56lr' \

Sample response:

{
  "extra": {
    "sub_description": "",
    "logid": "202008121419360101980821035705926A",
    "now": 1597213176393,
    "error_code": 0,
    "description": "",
    "sub_error_code": 0
  },
  "data": {
    "cursor": 1,
    "error_code": 0,
    "description": "",
    "has_more": true,
    "list": [
      {
        "top": true,
        "comment_id": "",
        "comment_user_id": "",
        "content": "回复内容",
        "create_time": 1607399832,
        "digg_count": 647,
        "reply_comment_total": 12
      }
    ]
  }
}

Code demonstration sample

* Create engineering project
     */
    public function createProjectAction() {         $this->useLayout('dydqtshoppc-head.html');         $id = $this->request->getIntParam('id');

        //获取视频信息
        $video_model    = new App_Model_Douyin_MysqlVideoStorage();
        $video_info     = $video_model->getRowByIdSid($id, $this->sid);
        $use_platform   = empty($video_info['dv_use_platform']) ? [] : json_decode($video_info['dv_use_platform'], 1);

        if (!empty($video_info)) {
            $video_cfg  = empty($video_info['dv_platform']) ? null : json_decode($video_info['dv_platform'], 1);
        }

        //Video mixed cutting mode
        $video_mixed_mode = plum_parse_config('project_mixed_mode','dydqt/project');

        $this->output['video_info']     = $video_info;
        $this->output['use_platform']   = $use_platform;
        $this->output['video_cfg']      = empty($video_cfg) ? null : $video_cfg;
        $this->output['video_mixed_mode']   = $video_mixed_mode;
        $this->output['font_map']   = (new App_Plugin_Ffmpeg_VideoPlugin())->getFontMap();
        $color_list = plum_parse_config('color_list', 'config');
        $this->output['color_list'] = $color_list;
        //火山引擎、腾讯云配音
        $huoshan_vcn    = plum_parse_config('hsyq_vcn', 'system');
        $tencent_vcn    = plum_parse_config('txy_vcn', 'system');
        $this->output['audio_vcn']  = empty($tencent_vcn) ? $huoshan_vcn : $tencent_vcn;
        $this->output['platform_list']  = plum_parse_config('platform_list', 'dydqt/project');
        $this->displaySmarty('dydqtshoppc/video/create-project.tpl');
    }   

Guess you like

Origin blog.csdn.net/m0_71850852/article/details/125218051