Skip to content

Commit

Permalink
feat: add author_url to alternate response
Browse files Browse the repository at this point in the history
  • Loading branch information
okdargy committed Mar 15, 2024
1 parent 6b85c66 commit 7156155
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/util/generateAlternate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,26 @@ export default function generateAlternate(c: Context): {
version: string,
type: string,
author_name: string,
author_url: string,
provider_name: string
provider_url: string
title: string
} {
const { likes, comments, shares, unique_id, images } = c.req.query()

let author_name = '';
if (likes) author_name += `❤️ ${formatNumber(likes)} `;
if (comments) author_name += `💬 ${formatNumber(comments)} `;
if (shares) author_name += `📤 ${formatNumber(shares)} `;
if (images) author_name += `🖼️ ${images}`;

return {
"version": "1.0",
"type": "link",
"author_name": `❤️ ${formatNumber(likes)} 💬 ${formatNumber(comments)} 📤 ${formatNumber(shares)} ${images ? '🖼️ ' + images : ''}`,
"author_name": author_name,
"author_url": `https://www.tiktok.com/${unique_id ? '@' + unique_id : ''}`,
"provider_name": 'fxTikTok',
"provider_url": "https://tnktok.com",
"provider_url": "https://github.com/okdargy/fxTikTok",
"title": `TikTok by @${unique_id}`
}
}

0 comments on commit 7156155

Please sign in to comment.