In an age when people still sent telegrams and paid for their messages by the word, the telephone companies—which were not to be outdone by an older technology—would proudly proclaim, “Every telephone is a telegraph office.”1 Much like today’s mobile phones, this combination of technologies made the world a smaller and more connected place, allowing people to do many of the same things that web-savvy users go online to do today, such as transferring money, booking tickets for passage by rail or sea, and ordering flowers, candy, books, and cigars for delivery to recipients in cities across the globe. In the late nineteenth and early twentieth centuries, when the world was connected not by the Internet or the web but by transatlantic cable, and the “last mile” was just a boy on a bicycle, how-to books such as Nelson Ross’s “How to Write Telegrams Properly,” a 1928 pamphlet, would joke that “brevity is the soul of telegraphy.” Though it is often said that it costs nothing to be polite, the telegraph was a communication medium whose users had to pay to say “please” and pay twice as much again to say ”thank you.” If the telegraph was the Internet of its day, the telegram was its tweet.
We tend to use words sparingly when we have to buy them retail. Yet while constraints often bring out the best in us, telegraphy was not widely considered a medium in which writers did their best work. Even James Joyce, one of the most creative writers of the twentieth century, could only muster the three-word missive “son born Jim” to his brother Stanislaus on the birth of his son Giorgio.2 Ernest Hemingway’s editor, Maxwell Perkins, was even briefer, sending a one-word telegram, “Girl,” on the birth of his daughter, while Sigmund Freud joked—in a way that will surprise no one—that while news of a boy surely deserved a telegram, news of a girl warranted only a letter.3
Telegrams were much faster than letters, of course, but they discouraged verbosity and encouraged instead a system of conventions, shorthands, and codes. However, even conventions are open to playful exploitation. When physicist Edward Teller, not a man celebrated for his linguistic creativity, telegraphed colleagues to notify them of the first successful detonation of a hydrogen bomb, his telegram was not unlike Joyce’s: “It’s a Boy.”4 Yet we should perhaps expect more from writers who are paid to be funny. When dispatched to Venice on an assignment by his editor at the New Yorker, the humorist Robert Benchley sent off this six-word telegram, “Streets full of water. Please advise,” which established the high-water mark of wit in the medium.5 But such stories are very much the exception rather than the norm, since telegrams were rarely intended for mass consumption. We know only of the best because their authors chose to share them after the fact, in anecdotes that improved with age. In some tellings, Benchley omitted the extravagance “please,” and in others he replaced “full of water” with “flooded.” Yet the best examples of the medium cost nothing at all to send because they were never actually sent, except in that world of third-hand anecdotes and after-dinner speeches where fable becomes fact. Sadly, the telegram that is often cited as the wittiest ever written belongs to the realm of the never sent. It would count as just another example of staircase wit from the age of telegraphy if the year it was supposed to have been sent, 1843, was not a full year before Samuel Morse sent the first official telegram—the grandiose “What God Hath Wrought”—in 1844.6
When General Charles Napier conquered the Indian province of Sindh (now part of Pakistan) in 1843 on behalf of his employers in the East India Company, he is said to have cheekily sent them the one-word telegram, “Peccavi.”7 Napier was a veteran of the Peninsular War, whose mandate in Sindh was to suppress the rebellious elements who were making commerce difficult for his employers, and he brought with him the public school philosophy that one is never more predisposed to gratitude than after receiving a sound thrashing. But Napier exceeded his mandate by brutally bringing the whole province to heel, and though he was richly rewarded for his efforts, his military zeal was the target of much criticism in the newspapers and in parliament. So Peccavi, Latin for “I have sinned,” was both a confession of his guilt and a celebration of his military victory—in other words, “I may have sinned but I have Sindh.” It didn’t hurt that Napier could show off his classical education in the process and flatter his employers too by acknowledging that they were also educated enough to understand Latin.
Napier’s witticism rings true mainly because we want it to be true. It caps a witty anecdote that hides the horrors of imperial repression behind a clever pun. Like the many instances of verbal ineptitude that folk history attaches to Vice President Dan Quayle—such as the tale of how, on a tour of Latin America, Quayle expressed regret at not having taken Latin classes in high school—we prefer the humorous legend to the boring truth. But just as Quayle’s tale of Latin witlessness was invented by a late-night comic and later misremembered and misquoted as historical fact by a willing electorate, Napier’s tale of Latin wit was invented by a schoolgirl, Catherine Winkworth, who joked to her teacher that “Peccavi” would have been the wittiest way for the overzealous general to signal his triumph to his disapproving bosses.8 Winkworth sent her joke to the editors of a new humor magazine, Punch, and Peccavi soon became part of the official Napier biography.
If Napier’s telegram that never was seems like a lost opportunity to impress future historians, future generals were more than ready to make up for Napier’s oversight. In 1856, when the British annexed the Indian province of Oudh (whose name rhymes with loud), the governor-general of India, Lord Dalhousie, sent a one-word telegram, “Vovi,” to the Foreign Office in London. Taking his cue from the schoolgirl of the decade before, Dalhousie’s Vovi is Latin for “I have vowed,” and can thus be read as a pun for “I have Oudh [as I vowed].” But the governor’s annexation of Oudh was to stir rebellious feelings among the ill-treated population, forcing General Colin Campbell (later Baron Clyde) to take and later retake the city of Lucknow following the Sepoy mutiny of 1857. After capturing Lucknow for the second time in 1858, Campbell is said to have sent yet another Latin joke by telegraph. But inflation was clearly taking its toll, for Campbell now needed three words—“Nunc fortunatus sum,” meaning “I am in luck now”—to signal his victory with a pun. In military circles, the Latin pun was fast becoming a telegraphic meme with which generals could simultaneously paint a veneer of polite society over the brutality of imperialism and cement their reputations in the history books.9
We can see why puns such as “Peccavi” and its later variants might have appealed to a clever child such as Catherine Winkworth. Like most other instances of creativity, linguistic or otherwise, Winkworth’s pun made the strange seem more familiar and the familiar seem just a little stranger and more exotic. New ways of referring to the distant corners of the British Empire could be fashioned from the stuff of everyday schoolwork, while the banal substance of this work—boring Latin—could be put to new and clever uses. But what could drive such men of state as Dalhousie, and such men of war as Napier and Campbell, to quite literally speak (if only in our collective imaginations) like a schoolgirl, albeit one with a classical education and a dry wit? Aristotle said it best when he defined humor as a form of educated insolence, for linguistic creativity is an essentially precocious aspect of the way we use language.10 Its precocity is anchored in a number of seemingly contradictory desires: the desire to fit in, balanced with the desire to show off; the desire to respect tradition while demonstrating a mastery over convention; the desire to belong while striving to stand out; and the desire to follow (or be seen to follow) in the footsteps of past masters while blazing a trail of one’s own. Having expended blood, treasure, and goodwill to secure a brutal victory, it may indeed seem juvenile for “great” men to exult in childish wordplay, but these puns offer the perfect symbol of what (we think) their creators were trying to achieve. They reflect not just a contest of meanings but a contest of cultures and class systems, in which the “heroic” champions of high-minded Western values (represented by a Latin education and a respect for the European classics) were seen to triumph over the peoples, the cities, and the much older traditions of the East. In truth, none of these men may have sent the telegrams for which they are remembered, but our willingness to keep the stories alive says a great deal about why we use language creatively and how we use technologies to communicate.
We cherish the few examples of true creativity that survive, in fact or legend, from the bygone age of telegraphy, but Twitter, the modern inheritor of the best aspects of the telegraph, offers us this creativity in free-flowing abundance. Indeed, while the inner workings of the telegraph (or the “Victorian Internet,” as writer Tom Standage calls it) had a significant human component, Twitter’s end-to-end automation means that our machines are just as capable of sending and receiving tweets as we are.11 Twitter’s application program interface (API) is specifically designed to allow other pieces of software, such as smartphone apps, to exploit all of its read and write services. These other apps may simply offer intermediary services to their human users, or they may be autonomous consumers and generators of content in their own right. On Twitter we call these mechanical generators of content “Twitterbots,” for (ro)bots that have been designed to operate their own Twitter accounts. But are these bots capable of the same kinds of educated insolence that we see humans produce on Twitter? Are they capable of generating messages with the same double-edged cleverness and elegant concision as Winkworth’s “Peccavi” or Benchley’s “Streets filled with water. Please advise”? The answer to each of these questions is a qualified yes.
Human creativity is a constantly replenished resource on Twitter, where a stream of newly minted hashtags marks the birth of new challenges to received wisdom and encourages fresh perspectives on the stale and too familiar. Anyone can join in the fun simply by marking one’s own tweets with the hashtag du jour or by inventing a new hashtag of one’s own to elicit conceptual and linguistic innovation from others. Consider the hashtag #JamesEllroyStarWars, minted by the comedian Patton Oswalt to encourage his followers to blend the innocent, fairy-tale world of Star Wars with the noirish, argot-heavy world of writer James Ellroy’s Los Angeles, a world in which everyone is on the make, on the take, and quick with the slang. This specific tag, one of many minted on Twitter every day, allows Twitter users to show off their knowledge of two very different milieus, yielding such gems as “Ackbar smelled like a plate of calamari, but those bug eyes saw the invisible inevitability. Trap” (from Twitter user @PearlRiverFlow) and “Leia kissed Luke on the mouth. Deep down she knew he was her brother, but she grooved on it” (from @The_Jump_Room). Twitterbot designers do not set out to replace or supplant this creativity; they simply aim to augment it with what they know and do best: clever engineering. Whether you are a regular Twitter user responding to the creative challenge of how to add your own voice to the game of #JamesEllroyStarWars or a bot designer responding to the engineering challenge of building a robot to generate responses that you could never write yourself, the challenge is much the same, if only taken to the metalevel in the latter instance.
There is no reason, in principle at least, why we cannot give our machines enough knowledge of the world to appear educated, or enough metaknowledge to use this education in insolent and entertaining ways. The profound questions of whether a machine can ever feel pride at showing off its “education” to others, or feel surprise at the effectiveness of its own defiance of convention, or feel the joy that comes from being playfully insolent to others are questions we must leave to the philosophers. We can suggest answers in how we go about building and then critiquing our bots, but rather than present a definitive philosophical position, this book instead focuses on ideas, methods, tools, and resources for crafting novel Twitterbots as a well-matched marriage of software engineering and knowledge engineering. Whether our Twitterbots are genuinely creative in their own right, or merely showcases for the metacreativity of their creators, is a question we leave to our readers to answer for themselves. But however one views their efforts, these bots make Twitter a more creative place for everyone.
Most Twitterbots are simple software constructs that make a virtue of their simplicity. Their value is to be measured in ideas rather than in lines of code. Prolific Twitterbot builder Darius Kazemi calls such bots tiny subversions, simple creations that amuse and provoke, and whose very artificiality prompts us to think a little more about the nature of human creativity.12 Kazemi’s bot @twoheadlines subverts the daily news, creating one imaginary headline from two real ones. Fabricated headlines, such as “Miss Universe attacks northeast Nigerian city; dozens killed,” make us laugh and make us think about the baggage we bring with us to a news story (e.g., that stories about Miss Universe are fluff, while stories about Boko Haram are bleak). @pentametron, a Twitterbot by developer Ranjit Bhatnagar, finds accidental poetry in the random musings of the Twittersphere. Its technique is simple: find two tweets of ten syllables each that can be read as though written in the poetic meter of iambic pentameter, where every second syllable is stressed and follows an unstressed syllable. Shakespeare’s classic line “But, soft! What light through yonder window breaks?” is the model of iambic pentameter. By pairing two such tweets randomly if they rhyme on their last syllables, @pentametron creates rhyming couplets by pairing tweets such as, “Come on and slam, and welcome to the jam,” with, “Many Twitter profiles are filled with spam.” Although @pentametron lacks understanding of what each tweet might actually mean, its resulting blends are often charming, surprising, and highly retweetable. The bot encourages us to understand each tweet in a new light, and perhaps think a little more, and a little more deeply, about what it is that makes any text worthy of the label “poem.”
It takes knowledge—of Twitter, of language, of poetry, of the news—for a bot to insolently spin off new tweets (with new meanings) from the thoughts and words of others. Yet in the popular imagination, the word bot is associated with an altogether darker strain of educated insolence, one in which malevolent software agents exploit an inbuilt knowledge of network protocols and security conventions to disrupt and pervert the operation of other software systems. Though the “hackers” who build these systems are not lacking in creativity, theirs is an unbalanced creativity that places an undue emphasis on insolence over education. However, this book is born of the belief that not all hackers are devious and not all bots are insidious. The word “hacker” has an older sense, one that denotes any programmer who takes joy in the pure act of software creation, while “bot” can mean any autonomous software system that is designed to help, amuse, provoke, and even inspire. Although these meanings are not currently the dominant senses of the words hacker and bot, the rise of the Twitterbots in the world of social media is actively reshaping our expectations of software that is both intelligent and creative.13 This book focuses on this altogether more satisfying and benign, if benignly insolent, world of bot hacking.
Western Union, the most iconic of telegraph companies, sent its last telegram on January 27, 2006, though telegrams had already been viewed as anachronisms for decades.14 The British post office discontinued the service in 1982, yet the idea, if not the reality, of the telegram still held a secure place in the language and the popular imagination. So, for instance, the ritual of reading “telegrams” from absentee guests at wedding banquets continued unabated, even if the telegrams of old were now replaced with faxes, emails, and texts. It took two months after Western Union killed the telegram for Twitter to post its first public tweet, on March 21, 2006, long before the word tweet was even coined (the earliest tweets were called twitters or status updates). That first tweet, from Twitter cofounder Jack Dorsey, had none of the grandeur of Morse’s “What God hath wrought” and showed instead a mix of humility and brand uncertainty when he claimed to be setting up “my twttr.” It was, then, more of a small step than a giant leap. But Dorsey’s tweet was marking time in more ways than one. Unlike the ephemeral telegrams of yore, the most important instances of which are now found only in the journalistic record (in the best cases) or in apocryphal legend (in the worst, and most likely, cases), this first tweet for Twitter still exists as part of Dorsey’s official Twitter timeline. Indeed, the tweet, which has a unique status ID, also occurs in the timelines of many other Twitter users, since it has been retweeted (which is to say, forwarded from user to user) over 100,000 times since its minting. Dorsey’s tweet has a URL that reveals its unique status id:
https://twitter.com/jack/status/20
Only the earliest tweets have such an impressively low-status ID. Those first tweets were called status updates because Twitter was originally conceived as a service that would allow its users to keep friends, family, and other “followers” up-to-date on their comings and goings, that is, on their current status.15 Dorsey had been inspired by a secondary feature of instant messaging apps that allowed users to explain, with a small piece of text of the “gone fishing” variety, why they were currently unavailable to respond to incoming messages. This status bar was often wittier and more interesting than the actual messages themselves, and it seemed to be a valuable secondary channel for communication in its own right. With colleagues Biz Stone and Evan Williams, Dorsey set out to create an app for mobile phones that flipped this state of affairs upside down: the status message would now become the primary channel of communication between users. As the joke went in those early days, Twitter was an application that allowed you to tell the world what you had for breakfast. Because the service was designed to piggyback on the texting facilities of cell phones, the size of each status update was necessarily limited by the maximum length of a text message: 160 characters. A portion of this 160-character maximum was reserved for use by the app itself, to contain the name (or handle) of the sender, a colon, and a space, allowing users to use whatever was left over for their own text. Observing that this practice was unfair to users with long Twitter handles, Dorsey and Stone later standardized the division of space: the app would take just 20 characters for itself and give the remaining 140 to its users. A magic number was born, making 140 a new benchmark for verbal concision. Even as Twitter tinkers with its winning formula and offers users a heftier 280-character container for their thoughts, the platform’s original magic number reasserts itself in Twitter’s two-for-one arithmetic
The word tweet was coined not by Twitter itself but by its users, and was given the official imprimatur of the company only after it gained widespread use. The /status/ in the URL of each tweet is a fossilized reminder of those early days. Showing just how fast time flies, the URL of @CIA’s first tweet exposes this ID:
https://twitter.com/CIA/status/474971393852182528
The CIA’s first foray onto a social network that promotes both accountability and transparency—“We can neither confirm nor deny that this is our first tweet”—oozes with educated insolence, offering the world a winked acknowledgment of its own lack of accountability and transparency. This sharing of an open secret —trust us when we say we are not to be trusted—gives the tweet a self-referential irony that has since caused it to be retweeted over 300,000 times. We know exactly how many times this tweet and others have been retweeted because Twitter itself tracks these numbers, displays them in its app, and makes them available through its API. Though retweeting seems a marquee feature of the service, it was not built in from the beginning. Rather, just as the Big Mac and the Egg McMuffin were invented not at McDonald’s headquarters but by individual franchisees and adopted by the parent company only once they had proven themselves with customers, a variety of Twitter’s key features were first jury-rigged by its users out of sheer communicative necessity, long before they were officially supported by the software itself. Retweeting emerged as a convention whereby users would simply paste the text of one tweet into another and append the marker “RT” before the Twitter handle of the original author. But this approach, which gave little change from 140 characters, left resenders with little room in which to add commentaries of their own. Moreover, because all conventions are open to creative exploitation, whether the “It’s a boy!” convention exploited by Edward Teller to creatively mark the birth of his new technology or the “please advise” convention exploited by Robert Benchley to affect a journalistic naiveté, the RT convention lends itself to mischief, misrepresentation, and downright fabrication. Consider the following tweet that satirically channels the voice of another user:
Yes! We should send illegal aliens into space. RT @realDonaldTrump: My WALL will be so TREMENDOUS that aliens will see it from space.
The old RT convention allowed devious Twitter users to put words in the mouths of others, concocting subtle misrepresentations that were harder to detect than in this particular case. For this reason, Twitter introduced an official retweet function that allows an original tweet to be attached to another in its unedited entirety and frees up the surrounding tweet to use its full allocation of 140 characters for new text. Users, however, remain free to use the unofficial RT convention for mostly humorous ends, crafting their own works of educated insolence from the tweets of others.
Conventions rarely stay wedded to their intended patterns of use for very long. Creativity always finds a way, allowing humans to evolve new conventions or to find new ways of adapting old conventions to new uses for fresh meanings. Charge people by the word for their messages, and people will choose to express themselves with one long word rather than two short ones. Give people a means of sharing their joy at the birth of a child, and they will subvert it as a means of expressing joy at the dawn of a new age. Limit the messages that people can write to a mere 140 characters, and they will make a sport of this constraint, finding witty new ways to squeeze maximal value from every single character. Give engineers an API for building an ecology of third-party applications around your communication service, and they will create a rich set of new features and affordances for human users to enjoy. But they may also seek to allow nonhuman bots to use this API to share their own messages and their own meanings. The challenge of bending the affordances of Twitter’s API to the implementation of fully autonomous Twitterbots is one that will interest the engineer in all of us, but this technical challenge pales in comparison to the knowledge challenge of building bots that can bend the conventions of human interaction, crafting witty, provocative, and concise outputs that we humans will want to read and eagerly retweet. With this book, we set out to explore each of these challenges together.
Provocative writers have always been into “the whole brevity thing,” as The Dude so memorably put it in the 1998 movie The Big Lebowski. By saying less, a creative writer can imply so much more than words alone could faithfully articulate. Long before Twitter, writers had ample opportunity to derive semiotic sport from the brevity of their aphorisms, their poems, and even their newspaper articles. One writer in particular, the French modernist Félix Fénéon, elevated brevity into an art form. Fénéon, who lived in France over a century ago, exercised his talent for concision on a task that hardly seems worthy of the name “creative writing.” Fénéon was hired by the newspaper Le Matins to write a series of very short squibs on the various faits divers—crimes, court cases, coroners’ reports, and so on—from around France that were not worthy of a headline or a full article of their own. His squibs, or “novels in three lines,” as they later came to be called, were well-crafted tweets long before Twitter was even a technical possibility. Consider this 114-character example of Fénéon’s oeuvre, as translated into English by Luc Sante: “Love decidedly has a hard time sitting still. Émile Contet, 25 Rue Davy, pierced with his knife his wife's breast.” This 123-character cautionary tale is a personal favorite: “There is no longer a God even for drunkards. Kersilie, of Saint-Germain, who had mistaken the window for the door, is dead.” But this 133-character pen portrait of a thug with a scar for each year of his life must take the prize for sheer evocativeness: “On Bécu, 28, who arrived at Beaujon hospital with a gunshot wound, they counted 28 scars. His nickname in the underworld: The Target.” To prove the point that Fénéon and Twitter were made for each other, Luc Sante has created an account, @novelsin3lines, that contains all of Fénéon’s Le Matins squibs (or at least those clipped and saved by Fénéon’s partner) in separate tweets.16 As writers, we strive for just this kind of spareness and minimalist grace in our tweets, and as bot builders, we try to impart a similar talent for constructing texts that are just as lean and effective.
Fénéon’s belated tweets are all the better for leaving so much of the story to the reader’s imagination, and so, over a hundred years later, his miniature tales still resonate with the contemporary world. This is perhaps the greatest benefit of Twitter’s character limit: limiting how much we can say forces us to leave room for the rich imaginations of our readers, turning the construction of meaning into a truly collaborative affair. It is fascinating to see an established voice in the world of comedy come to grips with Twitter and the collaborative construction of meaning, and if we go back to the very start of the timelines for @theEllenShow, @robdelaney, or @SteveMartinToGo, we see a new voice slowly emerge as a blend of comedic sensibilities and Twitter conventions. When Steve Martin first took to the medium, he mixed one-off jokes with long-form conceits that he carefully elaborated over a series of connected tweets. As Martin himself recounts, it was critical feedback from followers that helped him to trim the unnecessary fat from his online persona, prompting a shift from long, piecemeal narratives to brief comedic jabs and interactive back-and-forths with his fans.17 Though it took time, Martin came to appreciate that on Twitter, less truly is more.
We can enjoy a similar retrospective on the outputs of a Twitterbot that remains under active development, watching with delight as the early additions in its timeline, its Hello Worlds, give way to a more polished and increasingly diverse repertoire of outputs. This latter point speaks to an emerging role for bots in the study of artificial intelligence. Though most bots spring from an older, aleatoric tradition rooted in surrealism and the humanities, not from the AI tradition, an increasing number of Twitterbots employ an ambitious mix of AI techniques, both of the old-school symbolic variety and the newer statistical school of machine learning. Twitter offers an ideal showcase for the outputs of our AI systems, one in which every single output is time-stamped and preserved for posterity. Every single hit and every single miss—for it is important to never delete any of the outputs of a Twitterbot, lest followers come to suspect a human is pulling all its strings—will be preserved in chronological order, as well as every single heart of approval and every single retweet. Most Twitterbots are whimsical creations, yet we should not diminish their value as explorers and pushers of boundaries, between sense and nonsense, creativity and common sense, or freshness and unoriginality. So why just read about the workings of an AI system in research papers that show only the cherry-picked examples, when you can experience all of its outputs firsthand and draw your own conclusions?
Writers and orators understood the creative value of concision long before the telegraph put a tariff on our words and Twitter asked us to ration our characters. Abraham Lincoln’s speech at Pennsylvania’s Gettysburg cemetery in 1863 is one of the most memorable ever given by an American statesman, and also one of the shortest. His speech, just 10 sentences of 271 words in total, distilled the essence of his feelings toward the Civil War, the fractious state of the Union, and—ironically—the inability of mere words to do justice to the sacrifice made by the fallen dead at the battle of Gettysburg four months earlier. Lincoln’s speech actually took second billing on that day: it followed a two-hour address by pastor and celebrated orator Edward Everett. It was Everett’s speech, dense with classical references to the landmark battles and triumphs of ancient Greece, that was expected to earn its place in the history books that day, while Lincoln himself described his own brief effort, which took just two minutes to recite, as a few “appropriate remarks.” Yet it is Lincoln’s words that we remember and quote today. It is the rhythms and cadences of “four score and seven years ago” and “government of the people, by the people, for the people” that have stood the test of time, and not just because the years have burnished the president’s memory and legacy. Everett himself put it well, albeit in typically prolix fashion, when he wrote Lincoln to say, “I should be glad if I could flatter myself that I came as near to the central idea of the occasion, in two hours, as you did in two minutes.”18 If Twitter encourages us to come as near as we can to the central idea of our message, we are often better for having taken the direct route.
Though the magic number of 140 has a wholly technical origin, its magic resides in how it encourages us to fold our thoughts, origami-style, into utterances that are as pithy as they are disposable. This magic may well fade now that Twitter, bending to commercial pressure, gives its users twice as much room to express themselves and imposes half as much need to edit themselves. Perhaps we are being overly conservative in fearing that some of Twitter’s magic will be lost as it reinvents tweets as more ample containers of content, encouraging more Everetts and fewer Lincolns to use the platform for self-expression. Our Twitterbots, however, will have no such qualms born of magical thinking, though we should recognize that many humans welcome bot outputs into their timelines because most are trifles that impose no great cognitive load on the reader. Throughout this book we cling to the view that—for our bots at least—140 characters retain the most magic for tweeting. No matter how ample a tweet is allowed to become, less will always be more.
Twitter’s original 140-character limit has captured the public’s imagination in ways that the 160-character limit on SMS texts never could, and in ways that 280 characters never will. The need for concision is also a license to be terse, encouraging us to write in the moment and produce tiny nuggets of wisdom rather than hefty helpings of content. The number 140 continues to hold a Kabalistic allure that belies its banal technical rationale, even to those who never tweet at all. It just sounds too arbitrary to be truly, well, arbitrary. But if Lincoln’s masterful speech can be tweeted in a half-score and two tweets, then we can all find a way to express ourselves well while doing a linguistic limbo dance under Twitter’s low-hanging 140-character bar. A little arithmetic can tell us how many unique messages we can squeeze under that bar. The English alphabet has 26 letters, each of which can be used in upper- and lowercase variants, so these give us 52 possibilities per character. We need an additional 10 possibilities for the digits 0, . . . , 9 and more for various pieces of punctuation and bracketing. If we also throw a bunch of diacritics into the mix, we can round off the number of character possibilities for each position in a tweet to an even 100. A fully loaded tweet of 140 characters (what aficionados call a twoosh) can express 100140 different possible strings. If we assume that our alphabet of 100 characters also includes the empty character (giving us the freedom to use fewer than 140 characters), we can still construct up to 100140 possible tweets with our alphabet. Though 100140 is a very large number—think of the numeral 1 followed by 280 zeroes—it is a finite quantity that in principle can be exhausted in finite time by a simple looping algorithm. To add the spice of variety, we might even generate our 100140 tweets in a random order. But we can also hook up our generation algorithm to the Twitter API so as to—in principle, at least—tweet every one of those 100140 strings. In practice, however, the designers of the API have anticipated just this kind of abuse and limit the frequency with which any account can post a status update. So even a Twitterbot such as Metaphor-a-Minute (@metaphorminute) from bot builder Darius Kazemi is allowed to tweet its synthetic metaphors only once every two minutes.
Few Twitter users, not even dedicated completists, would follow a random anything-goes bot for very long. The less-is-more dictum applies just as much to how many messages we tweet as to the number of words or characters in those tweets. Raw generative power is not sufficient to attract the attention of followers. Our bots must show discernment by being selective in what they tweet. As a rule of thumb for human users, if what you tweet is of no interest to you or holds no meaning for you, it is unlikely to hold any interest or meaning for your potential followers. This rule applies almost as much to automated Twitterbots as it does to humans. If a tweet is generated just because it can and holds no particular meaning or relevance for the bot that generated it, then it is unlikely to hold any meaning for humans either. The “almost” here is an important qualification, since many of the Twitterbots in this book have no capacity at all to imbue their own outputs with any special meaning or relevance. These bots are idiom savants that just happen to say things that occasionally sound meaningful (and perhaps even profound) to human ears. Nonetheless, if we want to give our bots the ability to make meanings and not just strings, we have to give them the ability to explore the space of possible outputs to select only those that they (not us) consider worthy of human attention. This notion of discernment is not a crisp binary quality but an ill-defined continuum, and well-written bots will still bombard followers with more misses than their designers would prefer. Rather like throwing strands of spaghetti at a wall to see what sticks, many bots continue to hurl tweets at their users in the hope that some will earn a retweet.
Discernment can be costly if it requires deep analysis of any possible output, but many Twitterbots are crafted to explore a sweet spot in the space of possible text strings. In such a sweet spot, every possible string has a meaning. Consider a short story by Arthur C. Clarke, “The Nine-Billion Names of God.”19 Clarke’s tale concerns a lamasery of Himalayan monks who have spent many generations pursuing their goal of listing all the possible names of God in the belief that since the world began with the name of God, it must also end when the last possible name of God has finally been uttered. The monks have devised a holy alphabet, and for religious reasons known only to themselves, they have determined that any name of God can contain no more than nine of these letters. They impose a variety of other belief-based constraints too, such that no name may contain a subsequence of three repeated letters. This monastic Bletchley Park has always enumerated these names by hand, painstakingly writing each on a scrap of paper and pasting this scrap into a giant book. But the monks are not averse to the use of modern technology to complete their mission, and so they engage a computer company to send them a computer and a pair of programmers for the task. The computer is easily programmed with the alphabet of holy symbols and the rules for name generation, and it is quickly put to work generating and printing all 9 billion possibilities. Each is a valid holy name, and each has meaning to the monks (if not the program that generates it), so each deserves to be printed out and pasted into their special book. Clarke wrote this story in 1953, but if writing it today, he might well consider having those programmers build a Twitterbot, @everynameofgod, say, for the monks. Even with the frequency limitations imposed by Twitter’s API, tweeting each name in sequence would still be faster than printing and cutting and pasting each one individually. Besides, the notion that a Twitterbot might have God as a follower would be just too good to pass up.
In fact, the operation of this hypothetical @everynameofgod is not so very different from a popular and very real Twitterbot named @everycolorbot. This bot does exactly what its name implies, at least within the limited world of colors defined by the RGB color standard. Red, green, and blue are additive primary colors, which means that white light can be formed from the balanced addition of all three. Conversely, black is the total absence of all three. All other colors lying between these two extremes can be encoded as a trio of numbers: one for the Red component, one for the Green, and one for the Blue. Using a byte to code for each color component allows us 256 values for each, so three bytes together can differentiate 16,777,216 color combinations. Alphabetically, we can encode each byte with a two-character hexadecimal sequence, giving us sixteen choices (hex (6) + decimal (10) = 16) for each character position. The six-character D8B827 is thus the RGB code for yellow ochre, where R = D8, G = B8, and G = 27. Generating a six-character hex code with this alphabet is no harder than generating a nine-letter name of God from the alphabet of Clarke’s monks; indeed, since the names of God must obey certain rules (e.g., no repeat sequences of three letters), we can view @everycolorbot as a simplified instance of the same general process. But @everycolorbot’s RGB codes have affordances of their own. Each code can also be used to generate a swatch of the corresponding color (a block of yellow ochre, say) that the bot tweets alongside the abstract hex code. @everycolorbot currently has more than 130,000 followers, who retweet particular codes and color swatches because they say something about their own aesthetic preferences. Though many believe the world to have started with the words “Let there be light,” none have yet formed a doomsday cult that believes the world will end when @everycolorbot has tweeted every last one of light’s many possible RGB values.
Clarke’s story ends not with a loud bang but with an ironic whimper. As the programmers’ task nears completion, they worry that the monks will become violent when their religious beliefs are falsified by the world’s refusal to end on schedule. They make their excuses and leave early so as to be far away when their program—essentially nine nested for loops—terminates. They trek back down the mountain on ponies, laughing at the monks’ strange mix of superstition and technological savvy. After all, the monks have shown more faith in the value of computer-generated texts than they themselves would ever possess. But nearing the end of their trek, Clarke tells us of their alarming observation: “Overhead, without any fuss, the stars were going out.” Though the outputs of the program held no special meaning or relevance for the programmers who built it, those outputs found their audience and made their mark, both individually and collectively. A large number of bots, like @everycolorbot, work on much the same principle, albeit without the same world-shattering consequences. These Twitterbots are eager generators of tweets that they themselves can never understand, but somebody does, and for those who follow them, that is enough. So if it does not pay to be a naive monk when it comes to automated generation, neither does it pay to be a cynical engineer. Between these two extremes lies a happy medium that the best Twitterbot designers strive to find.
The more we and our Twitterbots generate just because we can, the more our intended meanings get lost in the noise of mere possibility. This point was made dramatically by another short story writer, Jorge Luis Borges, in his tale “The Library of Babel.”20 Borges imagined a vast library of interconnecting rooms whose shelves store every book imaginable. More formally, each book contains 410 pages of 40 lines per page, and each line comprises 80 characters, drawn from an alphabet of 22 letters, a comma, a space, and a period. Within these generous limits, Borges’s library contains every book ever written, or a translation of such, as well as every book that ever will, or could, be written. To pick a book at random here is no different from generating one at random, by rolling an alphabetic 25-sided die 410 × 40 × 80 times. So to find any meaning at all in this library, we desperately need a catalog to tell us which books are worth reading and which, by implication, are nonsense. Borges notes that the Library of Babel must inevitably contain such a catalog, insofar as any catalog will itself be just another book that lies within the generative reach of the library. Yet because the catalog is itself a book in the library, it will be lost in a sea of noise and misinformation just like every other book of interest. Indeed, there will be very many catalogs, each claiming to be authoritative, but we can have no idea how to tell those apart without a metacatalog, and so on and on, ad infinitum. It is no wonder that the librarians of Babel are prey to suicidal thoughts, while few readers ever find what they’re looking for in this library that has everything.
Borges provides us with some tantalizing examples of the library’s contents:
Everything would be in its blind volumes. Everything: the detailed history of the future, Aeschylus’ The Egyptians, the exact number of times that the waters of the Ganges have reflected the flight of a falcon, the secret and true nature of Rome, the encyclopedia Novalis would have constructed, my dreams and half-dreams at dawn on August 14, 1934, the proof of Pierre Fermat's theorem, the unwritten chapters of Edwin Drood, those same chapters translated into the language spoken by the Garamantes, the paradoxes Berkeley invented concerning Time but didn't publish, Urizen's books of iron, the premature epiphanies of Stephen Dedalus, which would be meaningless before a cycle of a thousand years, the Gnostic Gospel of Basilides, the song the sirens sang, the complete catalog of the Library, the proof of the inaccuracy of that catalog.
Yet the idea of the Library of Babel is more interesting than the real thing could ever be, just as Borges’s selective description of its esoteric highlights is more interesting than the library itself could be, just as a selective summary of the outputs of any wildly overgenerating Twitterbot will always be more interesting than the Twitterbot itself. The Library of Babel is tantalizing because it contains every true answer to every question, every evocative metaphor, every hilarious joke, every stirring speech, every moving elegy, every quotable poem, and every high-impact tweet. But it also contains every wrong answer, every bad joke, every doggerel poem, and every imaginable piece of linguistic excrescence. Without a means to distinguish them all, they are all equally worthless. Borges’s library reminds us that creativity is not just about generating the good stuff; it is just as much about not generating the bad stuff. Even the best human creators will produce good and bad in their careers, for a career without missteps is a career without creative risk taking. Naturally, our Twitterbots will also generate a mix of good and bad, of retweetable gems and forgettable dross. Our goal as metacreative bot builders is to achieve a balance between these two extremes.
If less is often more in linguistic creativity, Borges tells us that more is almost always less. The engineers of Clarke’s story scoff at Buddhist creation myths, but they also lack faith in the power of mere generation alone to achieve meaningful results. Though Clarke turns the tables on his protagonists (and us) to achieve a satirical effect, his surprise ending derives its power to surprise from our shared presumption that generation alone is the lesser part of creativity, just as creative writing is more than putting words and characters on paper. As Truman Capote once said of Jack Kerouac on hearing of the latter’s frenetic, Benzedrine-fueled stream-of-consciousness writing method, “That’s not writing, that’s typing.”21 Our Twitterbots can certainly type, but can they really write? The difference between mere generation—the generation of outputs just because we can, with no consideration of their meaning—and true creativity is easy to see in the extreme cases of “The Library of Babel” and “The Nine Billion Names of God.” But this call is much harder to make in the majority of cases, especially when dealing with the outputs of a successful writer or a sophisticated computer. In truth, because sustained innovation is hard and because it is tiring, all human creativity is a mix of unthinking generation and deliberate originality. This makes external critics so crucial to the creative process, because not even the creators themselves can always tell one from the other. When filming Star Wars for creator George Lucas, the actor Harrison Ford had a Capote moment of his own, though he expressed his opinion of Lucas’s script with less of Capote’s signature tartness and more of his own characteristic frankness: “George, you can type this shit but you can’t say it.”22 If this was Ford’s reaction to Lucas’s first Star Wars, we can only imagine his views of the overstuffed, more-is-less excess of the three prequels.
Lucas raided the kitchen cupboard of pop culture ideals and narrative tropes when he made those first Star Wars movies. Yet even with its leaden exposition and its corny dialogue, Lucas managed to plant the seed of something of lasting value. But not all critics took this benign view. In her book When the Lights Go Down, Pauline Kael had this to say about the film: “It’s an assemblage of spare parts. … Star Wars may be the only movie in which the first time around the surprises are reassuring. … The picture is synthesized from the mythology of serials and old comic books.”23 With American Graffiti, Star Wars, Raiders of the Lost Ark, and Willow, Lucas had turned nostalgia for lost innocence into an identifiable shtick. So it’s not surprising that the futuristic world of Star Wars is set A Long Time Ago (or that the villain of Willow is named General Kael). When you see this approach once, in a film like Star Wars or Raiders, it seems charming and fresh, if not very original: it really works! When you see it in film after film, it becomes a gimmick and begins to resemble mere generation more than true creativity. It takes effort to avoid repeating oneself and self-knowledge to recognize when one has. Even the greats, like Picasso, occasionally lapse into lazy self-pastiche, finding themselves unthinkingly doing the same things and repeating the same patterns over and over. When discussing a painting he considered one of his lesser works, Picasso memorably dismissed it as a fake. When pressed on the matter—for the indignant owner claimed to have seen Picasso work on that very picture in his studio—Picasso is said to have shrugged and said, “So what? I often paint fakes.”24 But unlike master artists such as Picasso, most bots are defined by their shtick and cannot easily transcend it. See enough of these bots’ outputs, and we see all their gimmicks laid bare. This is not to say that gimmicks are always a bad thing; rather, any particular gimmick should be used sparingly, perhaps in unpredictable combinations with others, and with enough self-knowledge to know when it is time to put an overused gimmick back on the shelf for a spell.
Like humans, Twitterbots work at various scales of complexity and ambition. Ambitious designers aspire for their best bots to operate as thought-provoking conceptual artists, exploring a space of often surprising possibilities, while others are built to be the software equivalent of street performers, each plying the same gimmicks on the same streets to an ever-changing parade of passersby each day.25 While the locals may soon tire of the same old shtick—the bot equivalent of the moving statue or the levitating man—each day brings new faces with new smiles and the occasional round of applause for the same reassuring surprises. A bot like @EnjoyTheMovie is clearly designed to deliver its share of familiar surprises, by tweeting spoilers to random Twitter users who unwisely express an interest in seeing a movie with a well-guarded twist. Tweet that the corn is a-poppin’ for an evening in front of the box to watch The Sixth Sense, and @EnjoyTheMovie will joyously ruin the movie by revealing that Bruce Willis is dead all along. Or tweet even a passing interest in seeing The Crying Game and the bot will spoil the midmovie transgender twist. Or at least the bot would, if it were not the target of sustained reports of abuse from its many victims—the kind of reports that get a bot suspended on Twitter. But this is very much the point of @EnjoyTheMovie. The bot is designed to ply its fixed repertoire of familiar surprises in ways that provoke the ire of its targets, and it is this ire—expressed with often hilarious profanity—that yields the truest and most affecting variety. This bot is the kind of street performer who makes sport of some unlucky tourists to earn laughter and applause from others.
But we should not be overly critical of Twitterbots with a limited repertoire that are designed to do just one kind of thing, especially if they do that thing well and to our amusement. Cocktail parties and country clubs are full of humans who operate in much the same way, telling the same old jokes, performing the same old tricks, using the same old catchphrases (“that’s what she said!”), and dining out on the same old anecdotes that grow with the retelling. These people live in a temporal-distortion bubble where no gimmick ever grows old. It is our lot to live outside that bubble, if only to burst it occasionally with a pinprick of reality. Consider the following exchange from the 1999 comedy Mystery Men, a film that follows the misadventures of a group of wannabe superheroes with rather underwhelming powers.26 Mr. Furious has anger issues, while the Sphinx’s only power is an ability to torture syntax until it yields a phony profundity:
The Sphinx:
He who questions training, only trains himself in asking questions. … Ah yes, work well on your new costumes my friends, for when you care for what is outside, what is inside cares for you. … Patience, my son. To summon your power for the conflict to come, you must first have power over that which conflicts you.
Mr. Furious:
Okay, am I the only one who finds these sayings just a little bit formulaic? “If you want to push something down, you have to pull it up. If you want to go left, you have to go right.” It’s …
The Sphinx:
Your temper is very quick, my friend. But until you learn to master your rage …
Mr. Furious:
Your rage will become your master? That’s what you were going to say. Right? Right?
The Sphinx:
Not necessarily.
Or rather, “Yes, necessarily,” for the Sphinx has hit on a successful gimmick for mere generation that turns casual utterances into guru-like prognostications. His shtick can appear deep, yet his rhetorical strategy is little more than repetition with crossover. The strategy is an old one that has been studied since antiquity under the name chiasmus (where chi, the cross-shaped Greek letter χ, signifies crossover). One may imbue the Sphinx’s utterances with real meaning, perhaps even a profound truth, but it seems clear that for this professor χ, meaning takes a backseat to surface form in his drive to seem wise and all knowing. Despite his short fuse, Mr. Furious has seen enough for his critique to be on target. The Sphinx could no more change his strategy if he were a Twitterbot, @ChiasmusBot say, forever fixed in its programming to perform the same trick over and over.
We meet people like the Sphinx all the time at social gatherings where a glib affability is encouraged, such as—sadly—academic cocktail parties. Indeed, the term cocktail party syndrome was coined to describe just this kind of sonorous chatterbox, always ready with a glib humorous response or an affable blend of clichés and platitudes. But cocktail party syndrome (aka chatterbox syndrome) is also used, more formally, by clinical psychologists to label the cluster of sociolinguistic traits that are often observed in children affected by hydrocephalus.27 The children who present with this syndrome are extremely loquacious and may appear highly sociable, yet this apparent verbal acumen conceals impaired social skills and a lower intelligence overall. Chatterbox syndrome allows these kids to speak with confidence and apparent knowledge of topics they know little about, using words whose true meanings are lost on them. Because the child’s knowledge of words and the ways they chunk into larger syntactic units exceeds his or her understanding of the meaning of those units in context, a child with chatterbox syndrome can sound and act remarkably like a Twitterbot. As we saw with the Sphinx, a fictional creation that distills the traits of the many phonies we have all met into a single caricature, adults occasionally exhibit the same traits without a clinical diagnosis to excuse them. Chatterbox traits are simply more pronounced in certain children (or in certain software systems) who use words to impress rather than to communicate. In the following excerpt from a 1974 study by Ellen Schwartz, the word child might well be replaced with Twitterbot and the word he by it without affecting the validity of its core message: “The child uses automatic phrases and clichés; at times he even quotes directly from television commercials or slang he has heard others use. He uses words from other contexts that almost but not quite fit his conversation.” Both @pentametron and @twoheadlines, two bots that assemble their tweets by directly quoting from others, benefit from the slightly discordant note that emerges when two quotations that almost but not quite fit are forced together. Note how Schwartz’s description of a child with chatterbox syndrome is also strikingly similar to Pauline Kael’s description of George Lucas’s patchwork creation, Star Wars. The chatterbox child treats language as its own source of cultural spare parts that can be recombined into an assemblage of familiar surprises: familiar because the parts are each so familiar, surprises because they may be put to jarring new uses that are not at all what we expect. So while the generative creativity we see in Twitterbots may be artificial, it sits on the very same continuum of magpie bricolage that links the chatterbox child to the adult Sphinx to the successful maker of blockbuster movies. It is a continuum we shall explore extensively with the aid of Twitterbots in this book.
In a study from 1983, the sociologist Neil McKeganey offers this assessment of a child, “Linda,” with chatterbox syndrome: “Linda lives in language and loves to talk and listen to it. She does not however always grasp the meaning and is inclined to indulge in the sound and play of words.”28 Like Linda, most Twitterbots “live in language” rather than in the real world. Their knowledge, such as it is, concerns words and their norms of association, and not the world in which their followers live. Although conversations with children like Linda can be engaging but disorienting for adults, these kids show an obvious love of language that bot builders often strive to capture with their own creations, with similarly jarring results. Yet whether we are dealing with a Twitterbot or a chatterbox child, the sophistication of their language can lead to unreasonable expectations that may, respectively, cause disillusionment for the bot’s followers and frustration for the child. McKeganey quotes a doctor who says this of Linda: “Talks like a grown up Yankee. Incredibly charming. Incredibly vulnerable. Adult language, infantile frustration threshold.” Our charming bots may not have Linda’s vulnerability to slights, but in their own way, they can be just as fragile and lacking in robustness. How Twitterbot designers react to this fragility will decide whether their bots are designed to openly engage with, or merely deceive, their human followers.
Though Linda’s reach for words far exceeds her grasp of their meaning, hers is not a pretentious use of language and its possibilities. For unlike phonies like the Sphinx, kids like Linda live in language rather than behind language, and so their loquaciousness is born more of exuberance than of deceit. The question for us as bot builders is whether we are driven more by the latter than the former, to build systems that aim to keep users from the truth rather than invite them in. If the public discourse about artificial intelligence has it that AI is primarily about the building of fake humans that can pass for real people in online dialogues, then AI is as much to blame for this corruption of its ideals as the popular press. From its roots in the modern era, when Alan Turing first proposed what is now called the Turing test in 1950, AI has been seen as an imitation game.29 Turing’s idea for a language-mediated test of intelligence and humanity has since become a science-fiction staple, but for Turing, this test was merely a thought experiment with which he hoped to peel away the veils of cultural and spiritual prejudices that we humans naturally bring to any consideration of nonhuman intelligence. If we can have a probing conversation with another agent about our feelings, our ambitious, our hobbies, our passions, our favorite movies and books, and not be able to tell whether we are speaking with another human or a machine, then that other agent must surely possess a level of intelligence that is, for the purposes of everyday conversation at least, just as real as a human being’s. Like a foreign sleeper agent with the deepest of deep covers, to fake it this well requires a machine to truly become what it is pretending to be. Consider this excerpt from Turing’s 1950 paper, where he imagines a human interrogator interviewing a “witness,” a writer of sonnets who may or may not be another human being:
Interrogator:
In the first line of your sonnet which reads “Shall I compare thee to a summer's day,” would not “a spring day” do as well or better?
Witness:
It wouldn’t scan.
Interrogator:
How about “a winter's day?” That would scan all right.
Witness:
Yes, but nobody wants to be compared to a winter’s day.
Interrogator:
Would you say Mr. Pickwick reminded you of Christmas?
Witness:
In a way.
Interrogator:
Yet Christmas is a winter’s day, and I do not think Mr. Pickwick would mind the comparison.
Witness:
I don’t think you’re serious. By a winter’s day one means a typical winter’s day, rather than a special one like Christmas.
Notice that Turing does not imagine his interrogator talking to a childlike Linda or to an adult like the Sphinx. He imagines a free-flowing dialogue between two well-educated adults, with an awareness of the classics and who can speak with ease about their feelings and impressions, or about complex cultural events such as Christmas. Indeed, Turing compares his test to a viva voce examination of a PhD candidate, in which an expert examiner interviews—though interrogates really is a more apt verb—a student about their research topic to see if they truly understand that topic in depth. Nobody passes a “viva” like this by subjecting the examiner’s words to a chiastic hernia or by wandering off topic and randomly quoting TV advertisements, jingles, and slogans. Yet the latter approach is not so very far from the mark when it comes to modern approaches to the Turing test. Since we still lack a sufficiently robust, knowledge-based technology to allow a machine to interact with a human with the deftness of the “witness” in the dialogue, the Turing test has instead been debased to the point that it resembles not so much The X Factor or America’s Got Talent but The Gong Show. While the purpose of a viva voce examination is not to fool but to impress an examiner, the same can no longer be said of Turing’s Test in its modern guise. It has become instead a faker’s charter.
Though we cannot expect our bots to interact with humans in the same way as Turing’s imaginary witness, this is not what Twitterbots have ever been about. Twitterbots are not fake humans, nor are they designed to fool other humans. Yes, it can be satisfying to see a passing Twitter user retweet or favorite the wholly fabricated output of one of our bots, in the belief that human intelligence was responsible for both its form and its meaning. We might even consider this eventuality—not a rare occurrence on Twitter, by any means—as yet another successful instance of a 140-character Turing test. But the truth is much simpler and just a little stranger: humans do not follow Twitterbots because they believe them to be human. Humans follow bots because they know them to be artificial and appreciate them all the more for this otherworldly artificiality. Every Twitterbot, no matter how simple or sophisticated, is a thought experiment given a digital form. Though many bots are one-trick ponies like the Sphinx, each embodies a hypothesis about the nature of meaning making and creativity that encourages its followers to become willing test subjects. Naturally, bot designers want to impress their followers as clever metacreators, but they also encourage these followers to speculate on the workings of their Twitterbots and notice when additional sophistication and new features have been added. Because bots are artificial but use human language and other systems of human signification to speak to human concerns, Twitterbots blur the line between the natural and the artificial. They show us how human meaning can arise via nonhuman means and reveal the hidden regularities at the heart of human behavior. So when we humans interfere with the autonomy of a Twitterbot, so that its outputs result from artificial artificial intelligence rather than wholly mechanical means, the bot’s followers naturally feel cheated and betrayed. The scandalous case of @horse_ebooks, a once-popular Twitterbot whose case we discuss in the next chapter, shows how Twitterbots turn the logic of the Turing test on its head: it is the possibility of humans pretending to be machines, not machines pretending to be humans, that most exercises those who build and follow bots on Twitter.
George Orwell said that every joke is a tiny revolution, a tiny attack on the facade of received wisdom that suggests the whole edifice is riven with fault lines.30 Orwell’s take on jokes is echoed in the words of bot builder Darius Kazemi, who builds his Twitterbots to be tiny subversions of the status quo. But whether we view Twitterbots as thought experiments, jokes, tiny subversions, or even tiny revolutions given digital form, these bots are typically small, idea-driven systems about which it is rather easy to make such big claims. We can talk big and at length about such systems, even when their behaviors can be captured in the simplest of rules and coded in the shortest of programs. Yet this is true of many domains of creative endeavor, for creativity is the ultimate cognitive lever. With the application of a shrewd insight at just the right time and in just the right place, a modicum of productive novelty allows us to reap disproportionate yields with surprisingly little effort. Twitterbots are just one more domain of endeavor in which the lever of creativity allows us to turn less—less code, less effort, less restraint—into more—more outputs, more diversity, more surprises. In that spirit of less is more, it is time to stop talking about Twitterbots in the general and start talking about them in the specific, and indeed, to start building these autonomous generative systems for ourselves.
In the chapters to come, we start at the very beginning, by registering the app that will become our first bot. We consider the role of the Twitter API and how it can be accessed by our own software systems—via a third-party library such as Twitter4J—to do all of the things that we humans do on Twitter. Just as chefs joke that beef tastes so much better when cooked in butter because these ingredients grow up together in the same cow, we conduct our exploration of Twitter and Twitterbots through Java, a popular programming language that has grown up hand in hand with the Web and contributed so much to the Web’s success. We can use other languages to write our Twitterbots, of course, with Python being another popular choice. However, our intent in this book is to focus more on the ideas and the principles that drive our bots than the specifics of their code. So when it more convenient to do so, we shall sketch only the broad strokes of the code, pushing the specific details into the website that accompanies this book. Though it is important to show real Twitterbots in the flesh, we do not want the code to get in the way of a real understanding of what that code is designed to achieve. So our promise to nontechnical readers is this: you don’t have to understand any of the code to understand the point that is being made, as our arguments will never hinge on the peculiarities of any programming language or platform. We take our cue in this regard not just from Alan Turing but from Ada Lovelace, the nineteenth-century mathematician who is now deservedly celebrated as the first “programmer” in the modern sense of the word, despite never having had a physical computer to program. Countess Lovelace is a singular figure in the history of computing, having succeeded at uniting the poetic tradition of her father, Lord Byron, with the scientific tradition of inventors such as her mentor, Charles Babbage, to found a whole new tradition of her own. This bridging of frequently antagonistic traditions was dubbed “poetical science” by Lovelace herself, and few other names seem quite so suited to the modus operandi of modern bot designers.31 As we’ll see throughout this book, even when occasionally flirting with code, Twitterbots are much more about ideas than they are about method calls, and they have as much to do with poetry and art as they do with science and engineering.
If Twitterbots were magic tricks, we hope this would be the kind of book that would get us drummed out of the Magic Circle. Twitterbots are not magic tricks, of course, even if they share some obvious similarities: each exploits the foibles of human psychology to amuse and surprise, and viewing each can appear mystifying at first. But whereas tricks involve deception and concealment—hence, the Magic Circle’s warning to any magician who dares to reveal the workings of a trick to the public—Twitterbots are designed to be open, about their artificiality and their inner mechanics. When a practitioner such as the infamous Masked Magician (of the Fox TV specials) pulls back the curtain on how the big Las Vegas–style tricks are really performed, the viewer can feel cheated because the sum of the mechanics often adds up to much less than the value of the illusion. In such cases, more definitely produces less, especially since a cultural cynicism about smoke and mirrors has long since inflected our response to stage magic. However, such practitioners have a larger and more laudable goal than winning audience share. By dispelling the mystery around the tried-and-true favorites of the cabaret hack, such exposés spur other magicians to invent new and more creative ways to renew their hold on the audience’s imagination. As Twitterbot designers rarely conceal the workings of their systems—indeed, concealment is often impossible, since most bots wear their generative principles on their sleeves—there is no comparable sense of gotcha! and no hacks to brusquely push aside. For where a magician says, “Look ye and wonder at the mystery of my magic,” the bot designer says, “Look. It really is this simple, so go do it for yourself.” While magic exposés produce stifled yawns, lifting the curtain on a clever bot can be a most satisfying experience, not because it shows how easily we can be fooled—since so few bots pretend to be human—but how easy it is to be creative if we put our minds to it.
With this book, we want readers to experience the best of bot worlds. It would be disingenuous of us to ask you to pardon this pun, as we intend to force it on you more than once. Our upcoming survey of the world of Twitterbots is called (you guessed it) The Best of Bot Worlds, and the website that accompanies this book (a trove of tools and data for building your own creative bots) can be found at http://www.bestofbotworlds.com. So, drum roll please, and on with the show.
You will by now have noticed that our preferred spelling for “Twitterbot” reflects a pair of choices regarding capitalization and spacing that are far from universal in online discussions of these magical little programs. Because Twitter is a proper noun, it seems natural to capitalize its uses in text, and we follow this pattern in also choosing to capitalize the word Twitterbot. Perhaps it is the informal and often playfully subversive nature of bots that leads many online to describe them as twitterbots with a small t, but in truth the decision to capitalize or not carries very little meaning. We do it here for consistency if for no other reason. While online discussions are just as likely to insert a space between “Twitter” (or “twitter”) and “bot,” we also show a preference here for the solid compound Twitterbot over either Twitter bot or twitter bot. Though bots come in many varieties and can operate across a diversity of platforms, our focus here sits resolutely on the bots that operate on Twitter and nowhere else. This book explores how Twitterbots exploit the unique affordances of Twitter to squeeze an extra measure of magic from language and social interaction, and our spelling of Twitterbot is intended to signify the special bond between bots and their host.