I am the Internet: AMA
I’m excited to announce my latest project, entitled I am the Internet: AMA. The site lets users ask the Internet questions, as though it were a real person. A real… crazy person who can’t spell for crap.
A big challenge with that project was to try to limit results to those that were conditional or future-facing (would, may, might). I also had to sift through responses, ignoring anything based in the first person (I, me, my) and keeping posts from the second person (you).
In addition to telling fortunes, Zoltar also was tailored to answer questions (allowing for first-person responses).
While it’s been fun to show off Zoltar at my work place, I wanted something that could be a little more accessible than a bot you had to add into Skype. So I came up with the idea of personifying the Internet as an actual person, allowing it to answer questions in a free form manner.
Previously, I had been keeping only “pure” tweets as responses (tweets that did not include @mentions, #hashtags, URLs, etc). With this latest version, I’m trying to use as many tweets as I can, and going through a lot of scrubbing and filtering and string manipulation to clean things up.
This has resulted in more varied responses to choose from and, hopefully, feels a little richer (with fewer repeats).
Unfortunately, the way the Twitter API is designed, I need to require users to log in before asking a question (due to something called rate limiting).
When a user sends in a question, I’m using RiTa to examine the text being sent. I extract out any nouns, verbs, and adjectives, and then do a Twitter search using a random selection of the keywords.
In some cases, I’ll do some extra checks and adjustments. If your question has the word ‘why’ in it, I’ll occasionally add the word ‘because’ into the search. This, hopefully, helps to keep some of the answers more on-topic to the original question.
Users can share a URL, which looks like this: http://www.i-am-the-internet.com/share?id=806609167645609984&f=1&c=0&a=0
Shared links can be viewed by anyone (without logging in). These are still searches against the Twitter API, but they’re counted against the app.
A quick rundown of the parameters:
– id is the twitter post ID
– f is a boolean (1/0), indicating whether the full tweet can be used.
– c is the cut position, where a tweet would need to be truncated.
– a is a boolean (1/), indicating whether audio should be enabled.
If you look at the console, you can see a comparison between the original tweet, and what is displayed after processing. Here’s an example of an original tweet:
And here’s what it looks like, after a lot of cleaning:
Of course, it’s all powered by people on Twitter – so you never know what you’ll get. Because the API results are limited to the past seven days’ worth of posts, the answers provided by “the Internet” will change over time.
The “Random” button keeps in line with the earlier predictions, and are a bit more future-based, more like fortunes.
And finally, in the bottom right corner… there are two icons. When viewing an answer, you can click the user icon to go and see the original tweet on Twitter. If you click on the audio icon, you can toggle on/off the voice(s) that come bundled with your web browser, courtesy of the SpeechSynthesis interface.
Most mobile users will only hear one voice, but desktop browsers should cycle through a few random ones.
I learned an awful lot on this project, as it was my first attempt at login/authentication (using Passport). It’s also the first time I’m using Express, and the first time I’m hosting an actual site on Heroku. It’s a React app, and also my first go at using webpack.
I’m happy (and a little exhausted) to finally have this done and posted. This is one of those projects that tickled me when I first thought of it, and by the time it’s up and running… I’m no longer sure how interesting or engaging it really is. I’ve just been staring at it for so long, now.
Still, I’m glad it’s up and excited folks will have a chance to interact with it. Him. Her. You get what I’m saying, here.
So… ask away!
I Made a Skype Bot – His Name is Zoltar
Augur 2.0: Free iPhone App That Uses Twitter to Predict the Future
Villanelle Bot: Poems in the Villanelle Form, Created Using Random Posts from Twitter