Skip to content

Instantly share code, notes, and snippets.

@dance2die dance2die/twitter.js
Created Jul 28, 2019

What would you like to do?
const Twitter = require('twitter')
const config = {
consumer_key: 'secret',
consumer_secret: 'secret',
access_token_key: 'secret',
access_token_secret: 'secret',
const client = new Twitter(config)
const update = (status, in_reply_to_status_id = null) =>'statuses/update', {
username: '@dance2die',
update('Testing twitter NPM library')
.then(tweet => {
console.log(`tweet #1 ==>`, tweet)
return update('Reply #1', tweet.id_str)
.catch(error => console.log(`error ==>`, error))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.