Stories

Detail Return Return

抖音私信卡片源碼,揭秘抖音私信卡片生成的源碼和技術原理 - Stories Detail

摘要

抖音卡片是如何生成的?其實抖音是直接抓取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 Avatar xiaoxxuejishu Avatar solvep Avatar jiavan Avatar youyoufei Avatar geeklab Avatar user_ze46ouik Avatar hsr2022 Avatar wuliaodeliema Avatar beverly0 Avatar javalover Avatar huaweiclouddeveloper Avatar
Favorites 35 users favorite the story!
Favorites

Add a new Comments

Some HTML is okay.