feat: twitter portfolio stats

This commit is contained in:
DIYgod
2023-08-07 19:09:09 +01:00
parent 6de03a24f3
commit 4128d8fcb9
+21
View File
@@ -118,6 +118,27 @@ export async function GET(req: Request) {
}
}
}
// https://twitter.com/DIYgod/status/1411724986977456131
case "twitter.com": {
const id = url.pathname.split("/")[3]
const data = await (
await fetch(
`https://cdn.syndication.twimg.com/tweet-result?id=${id}`,
{
headers: {
"User-Agent": ua,
Referer: "https://twitter.com/",
},
},
)
).json()
if (data.conversation_count) {
result = {
commentsCount: data.conversation_count,
}
}
}
}
return result
},