Added a default limit for how many tweets are returned in a timeline.
This commit is contained in:
parent
2d2779600c
commit
a51065db6f
2 changed files with 5 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue