Browse Source

Add author to jsonfeed

Thomas Dy 3 years ago
parent
commit
21534b3be3
1 changed files with 5 additions and 0 deletions
  1. 5 0
      format.ts

+ 5 - 0
format.ts

@@ -251,6 +251,11 @@ export function timelineAsJSON(username: string, tweets: Tweet[]): string {
       url: buildTwitterUrl(`/${tweet.user.screen_name}/status/${tweet.id_str}`),
       content_html: html,
       date_published: new Date(tweet.created_at).toISOString(),
+      authors: [{
+        name: `${displayTweet.user.name} - @${displayTweet.user.screen_name}`,
+        url: buildTwitterUrl(`/${displayTweet.user.screen_name}`),
+        avatar: displayTweet.user.profile_image_url_https,
+      }],
     };
   });
   return JSON.stringify({