瀏覽代碼

Add titles to items in jsonfeed

Thomas Dy 3 年之前
父節點
當前提交
e93d8587c6
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      format.ts

+ 1 - 0
format.ts

@@ -248,6 +248,7 @@ export function timelineAsJSON(username: string, tweets: Tweet[]): string {
     const html = joinChildren(children);
     return {
       id: tweet.id_str,
+      title: tweet.full_text.split('\n')[0],
       url: buildTwitterUrl(`/${tweet.user.screen_name}/status/${tweet.id_str}`),
       content_html: html,
       date_published: new Date(tweet.created_at).toISOString(),