Skip to content

Instantly share code, notes, and snippets.

@arvindrajnaidu
Last active March 5, 2020 01:34
Show Gist options
  • Select an option

  • Save arvindrajnaidu/ce99a20ad7f6e8c1c5943d99aea6d465 to your computer and use it in GitHub Desktop.

Select an option

Save arvindrajnaidu/ce99a20ad7f6e8c1c5943d99aea6d465 to your computer and use it in GitHub Desktop.
export default ({id}) => new Promise((resolve, reject) => {
try {
Twitter.get('statuses/show', {id}, function(error, tweet) {
// Is it the president?
if (tweet.user.id_str !== '25073877') {
return reject(error)
}
// Is he talking about me?
if (tweet.entities.user_mentions[0].screen_name !== 'buzzarvind') {
return reject(error)
}
// Unicef
PayPalAccount('38938XA763AD')
.send()
.then(resolve)
.catch(reject)
} catch (e) {
reject(e)
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment