動態

詳情 返回 返回

抖音私信卡片源碼,揭秘抖音私信卡片生成的源碼和技術原理 - 動態 詳情

摘要

抖音卡片是如何生成的?其實抖音是直接抓取html頁面的一些信息來生成封面圖、主標題、副標題的。

image.png

代碼

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover" />
    <link rel="shortcut icon" type="image/x-icon" href="這是封面圖URL" />
    <meta name="description" content="這是副標題" />
    <title>這是主標題</title>
    <meta property="og:title" content="這是主標題" />
    <meta property="og:description" content="這是副標題" />
    <meta property="og:url" content="跳轉鏈接" />
    <meta property="og:image" content="這是封面圖URL" />
</head>
<body>
    <h1>抖音卡片演示</h1>
</body>
</html>

傳到服務器,抖音掃碼,分享出去就是卡片!市面上的外鏈系統,抖音卡片就是這麼生成的。

成品

image.png

image.png

image.png

源碼

https://gitee.com/likeyun/liKeYun_Ylb

user avatar atguigu 頭像 xiaoxxuejishu 頭像 solvep 頭像 jiavan 頭像 youyoufei 頭像 geeklab 頭像 user_ze46ouik 頭像 hsr2022 頭像 wuliaodeliema 頭像 beverly0 頭像 javalover 頭像 huaweiclouddeveloper 頭像
點贊 35 用戶, 點贊了這篇動態!
點贊

Add a new 評論

Some HTML is okay.