So tying the trigger to the Calendar works . . . but only if the computer is not asleep. I had considered this initially but may have over estimated how often my computer was running. It was done more for amusement anyway so here’s a way to move the whole email/trigger piece to the server using PHP. It replaces the whole AppleScript portion of the previous iteration. I had no idea how to do this prior to Google leading me to the examples that are linked below. The first chunk runs the cURL portion and gets the Markov response from the other page and passes it to a variable- creatively named $DICKINSON in this case. I left the echo line in there as I used it to make sure things were working. The second chunk sends the email. You can see the $DICKINSON variable being passed in as both the message body and the subject. The final piece is triggering this page every so often using a cron task. I am not yet positive I’ve done that right. When I’m more sure, I’ll come back and update this.
I wanted a Twitterbot to push out Markov generated stuff from Emily Dickinson’s work. I wanted to do it fairly quickly as it was inspired by an awesome discussion yesterday with Jason Coats who will be teaching one of VCU’s online courses this summer on poetry. One of his goals was to encourage students to put themselves out there and engage with poetry. I thought mechanically created poetry might allow for a certain degree of freedom of analysis and Emily Dickinson’s work was particularly well suited to the Markov genre. As I already had a Markov generator running with some of the possible texts for Gardner and Jon’s MOOC this summer, it was easy enough to switch out the source material with Emily Dickinson’s work. It never hurts to be able to build what you discuss while still carrying on the discussion. That’s one of the things I love about computers. So that got me the Markov portion but it was on a web page and would require either a visit or a manual action to feed it into Twitter (which Jason had used previously with his students). To get at Twitter I needed a new Twitter account EmilyMkv which I got by using this GMail alias trick. It’s handy if you run out of unique emails. As I thought […]