🤖🐦experience automated tweeting thru github actions 🤖🐦

View on GitHub

self-service tweeting

any active member of IRC channel #dailybuild can post tweets from @dailybuild3 🦄😹 (except for kenster)


tip: To make sure your message is well-formed (since you dont have access to Twitter API keys), locally, you can comment out the Tweet Module import statement and the last line where the message is sent by the module. Instead, you can simply console.log({your message}) and see if your message is well-formed.

Working with unit tests (Jasmine JavaScript framework)

Using unit tests to fix bugs and develop new scripts will make our lives easier!

To run all unit tests :

  1. Add a new test file (ending in *Spec.js) in the /spec directory and write some test scenarios;
  2. In terminal prompt, make sure you are located (pwd) at the root of the project;
  3. type jasmine;
  4. The tests will be ran and a result outputted to same terminal;
  5. read the test framework output.

capture of command line with jasmine

automated tweeting scripts

Almost all @dailybuild3’s tweets are posted from automated scripts on a cron job. Here’s a list of the scripts:

name file name description data source author example
regular tweet regular-tweet.js user can submit a tweet then open pull-requer Or pass an msg argument to this file none or command-line arg socraticDev  
bofh-excuses pick a tech-related funny quote in sequential order in file .txt luxemboye capture of a bofh tweet
christmas-tweet christmas-tweet.js tweets number of days before Xmas none socraticDev capture of a xmas tweet
meme-tweet meme-tweet.js post a meme linky, meme’s title and author, and dankness rating .json socraticDev capture of a meme tweet
flat-earth-tweet flat-earth-tweet.js post a picture of a flat-earth funny img and a randomly pick text .json and query Googlebot’s server for the image socraticDev capture of a flat-earth-tweet
choose-major-tweet choose-major-tweet.js post about a specific college major, median income after graduation, and unemployment rate .csv socraticDev capture of a choose-major-tweet
dmv-tweet dmv-tweet.js tweets about the vanity license plate refused by dmv. stating the reason given by dmv’s clerk and the actual meaning of plate given by motorist csv socraticDev capture of a dmv-tweet