diff --git a/twitter/app.js b/twitter/app.js index 83ee4c0..79b3300 100644 --- a/twitter/app.js +++ b/twitter/app.js @@ -15,7 +15,7 @@ const client = new Twitter({ }); client.get('statuses/user_timeline', {screen_name: process.env.TWITTER_SCREEN_NAME}).then(tweets => { - return tweets.map((x, index) => { + return tweets.slice(0, process.env.TWITTER_TIMELINE_COUNT + 1 || 5 + 1).map((x, index) => { return { id: x.id_str, order: index, diff --git a/twitter/env.json b/twitter/env.json index 551368f..6b02a70 100644 --- a/twitter/env.json +++ b/twitter/env.json @@ -3,5 +3,7 @@ "TWITTER_CONSUMER_SECRET": true, "TWITTER_ACCESS_TOKEN_KEY": true, "TWITTER_ACCESS_TOKEN_SECRET": true, - "TWITTER_SCREEN_NAME": true -} \ No newline at end of file + "TWITTER_SCREEN_NAME": true, + "TWITTER_TIMELINE_COUNT": false +} +