After much ado, I was finally able to get a twitterbot up and running. I created a bot @somemodernist that tweets out lines from Virginia Woolf’s novel, Jacob’s Room (1922), whenever I run the module. I chose Jacob’s Room because Woolf wrote the novel with space breaks — that is, she divides the narrative with blank spaces into “scenes” or little sketches. I’ve done work on this novel before (I actually created a prototype for an online edition of the novel for my MA project), and I’m always really inspired by how the digital medium engages with Woolf’s work, in this case, with the fragmentary structure of her narrative and her use of blank spaces.
To make this bot, I used the tutorial from the “Build a Bot” workshop developed by Terian Koscik. Though I still had difficulty getting the bot up and running, the workshop was extremely helpful for my goal, which was to get a bot to tweet lines in succession from a text file.
That being said, working on this bot actually gave me an idea for something more interesting (unfortunately, @somemodernist isn’t quite as robust as I want it to be, the lines don’t tweet neatly and it won’t run without my prompting). In the near future, maybe over the break, I’m going to make another bot for Woolf’s novel The Waves. For those who are unfamiliar with this novel, the narrative runs through the stream-of-conscious of six different characters, and their thoughts at times share the same phrases and images. For that reason, there’s an interesting literature on Woolf’s creation of a shared consciousness, if any of you guys are interested. In making this bot, I’m going to get more deeply into Python (which is something I’ve been meaning to do, now I have an excuse!). My goal is to run a script that finds patterns of words or phrases throughout the novel and tweets them in succession, regardless of the speaker. The tweets will then facilitate more study on the shared language of the six characters in the novel.
I found some resources that will help with this kind of text analysis in Python. First there’s the Natural Language Processing with Python (NLTK) Book, which is an online book that teaches beginners how to do text analysis in Python. Then there’s the pattern.en module, which allows for more advanced syntactic searches and analysis, and finally there’s the TextBlob module, which is like a more beginner-friendly library of scripts for processing text.