mirror of
https://github.com/yuzu-emu/shared-hugo-scripts.git
synced 2024-12-22 14:05:28 +00:00
Added a default limit for how many tweets are returned in a timeline.
This commit is contained in:
parent
2d2779600c
commit
a51065db6f
|
@ -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