Skip to content

Instantly share code, notes, and snippets.

@vncsna
Last active March 19, 2021 18:18
Show Gist options
  • Save vncsna/c40088ff215ad2dbe6b45e83ac854159 to your computer and use it in GitHub Desktop.
Save vncsna/c40088ff215ad2dbe6b45e83ac854159 to your computer and use it in GitHub Desktop.
function post_tweet(tweet){
twitter.post(
'statuses/update',
{'status': tweet}
)
}
function post_phrase(){
let phrases = require('./scraping/pensador-phrases-2020-12-28.json')
let keys = Object.keys(phrases)
let k = Math.floor(Math.random() * keys.length)
let phrase = phrases[keys[k]].phrase
let author = phrases[keys[k]].author
console.log(phrase + ' - ' + author)
post_tweet(phrase + ' - ' + author)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment