Skip to content

Commit

Permalink
feat(route): twitter 路由新增:将话题提取为 category (#15735)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen authored May 27, 2024
1 parent 2b5f4d0 commit 2e839e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/routes/twitter/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => {
description += item.full_text;
description += img;
description += quote;

const category = description.match(/(\s)?(#[^\s<]+)/g)?.map((e) => e?.match(/#([^\s<]+)/)?.[1]);
if (readable) {
description += `<br clear='both' /><div style='clear: both'></div>`;
}
Expand All @@ -385,7 +385,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => {
pubDate: parseDate(item.created_at),
link,
guid: link.replace('x.com', 'twitter.com'),

category,
_extra:
(isRetweet && {
links: [
Expand Down

0 comments on commit 2e839e6

Please sign in to comment.