Earlier this evening I made a checklist of tasks I thought I would need to finish in order to get a viable working product ready to show for Saturday morning (plus two more that would need to get done at some point but weren't urgent). These were:
- learn to issue commands to R through the CLI (done)
- learn to pipe variables (like the user's query term) into those commands (not done yet with variables, but done with text - should be quick)
- output whatever R outputs into a static document (done via | pipe, but might switch to php)
- figure out how to automate serving this document (done, just fixed permissions, and now by piping right to the file on the server, the server automatically picks up those changes. Just need to trigger a refresh for the user, see below)
- direct user to the newly generated page (not done)
- listen for GET requests to server (not done)
- extract the search term from the URL (not done, and may not even do it this way anymore
- figure out the user experience - loading bar? (not done yet, related to how I redirect the user to the new page)
For now, it's very exciting that I was able to input a filename (the "-washington.md" file) and specify an output file (sentiments.txt) with this:
Rscript myscript.R < pathTo/1790-01-08-washington.md > /pathTo/sentiments.txt
and then throw in this fun command, inputting a .jpg of Trump and specifying an append to that same output sentiments.txt:
jp2a /pathTo/trump.jpg >> /pathTo/sentiments.txt
and ended up with this:
who knew I would ever be pumped to see this ascii-art face pop up on my screen! |
By the way, here's the original image:

Pretty good for a night's work if I may say. From the command line, I can specify a couple of filenames and get a readout of the sentiment of that text and an ascii-art image from jp2a as a bonus. If the user knew to hit refresh, the readout is even hitting the live server automatically, which is cool. Even though the sentiments from 1790 and the image of Trump have pretty much nothing to do with each other, this was a worthwhile task. I'm excited to try to figure out more PHP and get things hopefully running as a start-to-finish "use case" in the next day or two! I'll leave this image of my updated view of how the project components will fit together below, and call it a night.
![]() |
still a bit of a mess and I'm sure nothing close to UML-standard, but closer than before, and finally beginning to feel like it is reflecting reality more than just my ideas! |