Added a default limit for how many tweets are returned in a timeline.

This commit is contained in:
chris062689 2018-02-28 23:18:19 -05:00
parent 2d2779600c
commit a51065db6f
2 changed files with 5 additions and 3 deletions

View file

@ -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,

View file

@ -3,5 +3,7 @@
"TWITTER_CONSUMER_SECRET": true,
"TWITTER_ACCESS_TOKEN_KEY": true,
"TWITTER_ACCESS_TOKEN_SECRET": true,
"TWITTER_SCREEN_NAME": true
"TWITTER_SCREEN_NAME": true,
"TWITTER_TIMELINE_COUNT": false
}