The Twitter API is a playground, if you’re inclined toward social networks and information. Building a basic bot to interact with the platform via the backend functionality is a fun way to learn a few rudimentary capabilities. There are a few different ways to go about triggering bots and timeline activities but I’m going to give examples that rely on the Python language to make

things happen.

In early 2018 I acquired a Raspberry Pi to start prototyping a few projects and began initial experiments to learn to write code in Python. This included deploying packages such as Tweepy, which is a package that facilitates interfacing with the Twitter API via account credentials.

My first exercise was to create image collages that Wild West Analogy, an old account that had been sitting dormant for a few years, would post.

The current iteration of the script randomly selects one of my photos from a folder, it also randomly selects a phrase from an array to both tweet as text and write over top of the image in a Western-style font. It’s a very simple process but was a nice endeavor into generative art. I crowd-sourced the phrases on social media and from folks offline.

Having confirmed my ability to post via the API to the account, I decided to branch into engagement. When the account was initially created it was focused on instances of the phrase “like the Wild West” which is a commonly used idiom. So the next script pinged the search function to find 5 tweets that included those words then retweeted them. Again, very simple — it had been a number of years since I had worked with the Twitter API and didn’t want to rely on domains or major data management.

#technology #twitter #bots #artificial-intelligence #development #artificial intelligence

Bots on Bots on Bots on Twitter
1.65 GEEK