[Dusk. Three 20-something white men sit around a rectangular kitchen table, several piles of white and black cards stacked in front of them. Oh and some Busch Light cans.]
This all started when no one would play Cards Against Humanity with us. So we started pulling pairs of black and white cards off the stacks and sharing the ones that we thought were funny. “Someone should make a Twitter bot that automatically posts random combinations of these,” I thought aloud. No one responded because that is a stupid thing to say at a party. When we finally finished all of the black cards I went home and did it (two days later) anyway. To be fair this HAS been done before. @CAH_bot is a fine example of one. And its about 1600 tweets ahead of me. But I did it anyway because the world deserves more Twitter bots (and because I didn’t find that account until after I did all this work). How did I do it? Well I’m glad you asked. After I tracked down some text lists of the cards, I imported them into Excel and used its RANDBETWEEN() and INDIRECT() functions to pull cards from each list and paste them together. Once I copied them into a new Notepad document I used the code in the appropriately titled “How to Write a Twitter Bot with Python and tweepy” tutorial to automatically post to Twitter. All I had to do then was create a Twitter account and away I went. So here it is: @bot_CAH This little guy is more of a rough approximation of a Twitter bot. First, I should probably write up some Python that automatically generates the posts. Also it currently posts every 15 minutes, but only when I am using my Surface. So it won’t completely spam your Twitter feed. In a perfect world I would have it post every hour from a constantly running Raspberry Pi (basically just a tiny $35 computer that’s useful for things like this). This bot works in a completely different way from my first foray into Twitter automation. My other bot, @PH_papers, is based off this post and uses dlvr.it to automatically update the account based off a Google Alerts style search from PubMed. I would recommend you follow it if you are interested in hearing about the most up-to-date Pulmonary Hypertension research. So far most of my followers are doctors from Mexico. That’s how you know you’ve made it. In closing I would just like to say that this was a fun little experiment and that it has helped to reveal some deep truths about the universe.
1 Comment
|
Archives
July 2023
Categories
All
|