From e97838075345f252f5575e8489c0e11ff6870e36 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Tue, 26 Jul 2022 23:50:35 -0700 Subject: [PATCH] Added created_timestamp to API --- src/api.ts | 1 + src/types.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/api.ts b/src/api.ts index c0028a0..4c76b2f 100644 --- a/src/api.ts +++ b/src/api.ts @@ -65,6 +65,7 @@ const populateTweetProperties = async ( apiTweet.color = apiTweet.author.avatar_color; apiTweet.twitter_card = 'tweet'; apiTweet.created_at = tweet.created_at; + apiTweet.created_timestamp = new Date(tweet.created_at).getTime() / 1000; if (tweet.lang !== 'unk') { apiTweet.lang = tweet.lang; diff --git a/src/types.d.ts b/src/types.d.ts index 13e5098..eda48e0 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -88,6 +88,7 @@ interface APITweet { url: string; text: string; created_at: string; + created_timestamp: number; likes: number; retweets: number;