Trump Twitter Trasher, Network Everything, David Santiano

cheeto with that mold that sorta looks like hair but it’s not actually hair

trumpo

The Trump Twitter Trasher is a photograph of Donald Trump that has been modified by me to spit out his inane tweets into the trash(which will then be recycled). It works by a server utilizing the Twitter API to grab tweets from Donald Trump’s twitter stream and then storing them into memory in an array, where the tweets are used to populate an html page served by the website and to also be selected to put into the trash.

https://www.youtube.com/watch?v=qhkuF6bx9tE&feature=youtu.be

The technology used was a node.js server running on the back-end, which served up an html page and also communicated with an Arduino via serial communication for the purposes of printing the tweets.

The basic flow of information was:

Twitter —> node.js server —> html page with buttons for selection —> back to node.js server       —> Arduino —> Receipt Printer —> Trash

The whole project was a bit challenging, as I’ve never touched back-end web development before, so terms like sockets and routing and POST and GET requests really flew around my head, so what follows is the giant list of links that I used to obtain some of the knowledge that I need(and may not have needed as well):

http://stackoverflow.com/questions/12134554/node-js-external-js-and-css-files-just-using-node-js-not-express

http://www.dotnetcurry.com/nodejs/1144/nodejs-html-static-pages-website

http://stackoverflow.com/questions/6084360/using-node-js-as-a-simple-web-server

https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods

https://expressjs.com/en/starter/basic-routing.html

http://stackoverflow.com/questions/18831783/calling-a-server-side-function-from-client-sidehtml-button-onclick-in-node-js

https://nodejs.org/api/http.html

http://stackoverflow.com/questions/39215151/how-to-call-a-function-from-html-to-a-javascript-file-in-node-js

http://stackoverflow.com/questions/9670222/execute-a-nodejs-script-from-an-html-page

https://github.com/nebrius/raspi-io/wiki/Getting-a-Raspberry-Pi-ready-for-NodeBots

https://dev.twitter.com/streaming/reference/get/statuses/sample

https://www.npmjs.com/package/socket.io

https://www.npmjs.com/package/serialport

http://stackoverflow.com/questions/33465557/how-to-stop-page-reload-on-button-click-jquery

QUITE A BIT OF INFORMATION!

But, it was a great learning experience, I feel very comfortable now grabbing information from a source and guiding it as it flows through the network I created…342A2408

… and then into the trash.

Pretty great! But, I’d like to smooth out this nice orange diamond a bit more. During the show I noticed that notifying people of the current status of the printer via an alert wasn’t the best, so I want to integrate the warning a bit better. Also, there is a weird encoding issue with the tweet, and I’m thinking it may have to do with escape characters present in the tweet and all that jazz, so I’ll be looking into that. ALSO, I need to find a way to put it on the www.

Here’s some of the code, the html file, the arduino file, and also the node server javascript file:

 

Leave a Reply