Skip to content

Commit

Permalink
feat: add ended and move avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
okdargy committed Jun 9, 2024
1 parent 2fb4c27 commit a89a548
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/services/tiktok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ export async function scrapeLiveData(author: string): Promise<LiveRoom | Error>
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0',
Cookie: cookie.getCookiesAsString()
},
cf: {
cacheEverything: true,
cacheTtlByStatus: { '200-299': 86400, 404: 1, '500-599': 0 }
}
})

Expand Down
21 changes: 20 additions & 1 deletion src/templates/pages/LiveResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ export function LiveResponse(data: LiveRoom): JSX.Element {
let title = ''

title += `👀 ${formatNumber(String(data.liveRoomUserInfo.liveRoom.liveRoomStats.userCount))} `
title += `🕒 ${formatTime(data.liveRoomUserInfo.liveRoom.startTime)} `

console.log(data.liveRoomUserInfo.liveRoom.status)
if(data.liveRoomUserInfo.liveRoom.status !== 4) { // live has NOT ended
title += `🔴 LIVE `
title += `🕒 ${formatTime(data.liveRoomUserInfo.liveRoom.startTime)} `
} else {
title += `⌛ ENDED `
}

return (
<>
Expand Down Expand Up @@ -43,6 +50,18 @@ export function LiveResponse(data: LiveRoom): JSX.Element {
{
name: 'og:image',
content: data.liveRoomUserInfo.user.avatarLarger
},
{
name: 'og:image:type',
content: 'image/jpeg'
},
{
name: 'og:type',
content: 'image.other'
},
{
name: 'twitter:card',
content: 'summary_large_image'
}
],
{
Expand Down

0 comments on commit a89a548

Please sign in to comment.