diff --git a/data/filter.json b/data/filter.json index 2f019a13..388d29e8 100644 --- a/data/filter.json +++ b/data/filter.json @@ -1,7 +1,7 @@ { "latest": [ 151, 53994, 54570, 54481, 54537, 54302, 53944, 55768, 55855, 56592, 54986, - 56875, 56873, 56666, 55996, 57407, 56249, 57858, 56973, 58600 + 56875, 56873, 56666, 55996, 57407, 56249, 57858, 56973, 58600, 57399 ], "comment": [54986], "comment_content": ["snowcherryblossom"] diff --git a/src/app/api/tweet/route.ts b/src/app/api/tweet/route.ts index 5553b156..cfb93142 100644 --- a/src/app/api/tweet/route.ts +++ b/src/app/api/tweet/route.ts @@ -15,7 +15,7 @@ export async function GET(req: Request): Promise { const tweet = (await cacheGet({ key: `tweet/${tweetId}`, noUpdate: true, - expireTime: 60 * 60 * 24 * 3, + noExpire: true, getValueFun: async () => await getTweet(tweetId), })) as Tweet | undefined return res.status(tweet ? 200 : 404).json({ data: tweet ?? null }) diff --git a/src/components/ui/Tweet.tsx b/src/components/ui/Tweet.tsx index e5e15d7d..86441f14 100644 --- a/src/components/ui/Tweet.tsx +++ b/src/components/ui/Tweet.tsx @@ -11,13 +11,20 @@ const components: TwitterComponents = { MediaImg: (props) => tweet-media, } -export default function Tweet({ id }: { id: string }) { +export default function Tweet({ + id, + fullUrl, +}: { + id: string + fullUrl: string +}) { return (
{fullUrl}} />
) diff --git a/src/markdown/embed-transformers/Tweet.ts b/src/markdown/embed-transformers/Tweet.ts index 3108e21d..91fdccad 100644 --- a/src/markdown/embed-transformers/Tweet.ts +++ b/src/markdown/embed-transformers/Tweet.ts @@ -8,12 +8,15 @@ export const TweetTransformer: Transformer = { shouldTransform(url) { const { host, pathname } = url - return isHostIncludes("twitter.com", host) && pathname.includes("/status/") + return ( + (isHostIncludes("twitter.com", host) || isHostIncludes("x.com", host)) && + pathname.includes("/status/") + ) }, getHTML(url) { const { pathname } = url const matched = match<{ id: string }>("/:user/status/:id")(pathname) if (!matched) return - return `` + return `` }, }