Skip to content

Instantly share code, notes, and snippets.

@vncsna
Last active March 19, 2021 18:18
Show Gist options
  • Save vncsna/c383e9c0387632815f691500c24ed874 to your computer and use it in GitHub Desktop.
Save vncsna/c383e9c0387632815f691500c24ed874 to your computer and use it in GitHub Desktop.
twitter
.get(
'statuses/user_timeline',
{screen_name: 'vncsna',
count: 200,
exclude_replies: true}
)
.then(result => {
tweets = result.data
for (let tweet of tweets) {
created_at = new Date(tweet.created_at).getTime()
elapsed_time = (Date.now() - created_at) / 8.64e+7
elapsed_time = elapsed_time / 42
if (tweet.text.includes('RT') &&
Math.random() < elapsed_time ** 4.0 + .02) {
console.log(tweet.text)
rogerio_skylab(tweet.id_str)
}
}
})
.catch(error => {
console.log(error)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment