OpenAI X Bot

Experimenting with OpenAI

Brushing off the cobwebs of some of my personal projects. I’ve started messing with a bot script that I had started a couple of years ago. The script was very crude and my first attempt at using the X (Twitter) API. It would simply pick a news story from two or three hard coded media sources, and give a greeting with the time and link to the story.

But … by plugging OpenAI into the equation, I’ve been able to make my bot seem pretty legit. Now, I grab the news source (still from a static list of RSS feeds) and ask OpenAI to write a short message about it. I asked it to give it a cowboy personality, and to have a certain political slant. I gotta say, it was easy and it worked like a charm!

What’s Next?

I want to keep playing with this bot. Right now it is picking the news article randomly from a random news site. I asked ChatGPT to give me a list of feeds in a JSON format, and voila. I stored this as an enum.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"BBC News": "http://feeds.bbci.co.uk/news/rss.xml",
"CNN": "http://rss.cnn.com/rss/edition.rss",
"Reuters": "http://feeds.reuters.com/reuters/topNews",
"The New York Times": "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml",
"The Guardian": "https://www.theguardian.com/world/rss",
"NPR": "https://feeds.npr.org/1001/rss.xml",
"Al Jazeera English": "https://www.aljazeera.com/xml/rss/all.xml",
"Associated Press (AP)": "https://apnews.com/rss",
"Washington Post": "http://feeds.washingtonpost.com/rss/world",
"Bloomberg": "https://www.bloomberg.com/feed/podcast/etf-report.xml",
"Financial Times": "https://www.ft.com/?format=rss",
"ABC News": "https://abcnews.go.com/abcnews/topstories",
"CBS News": "https://www.cbsnews.com/latest/rss/main",
"NBC News": "http://feeds.nbcnews.com/nbcnews/public/news",
"Politico": "https://www.politico.com/rss/politicopicks.xml",
"Fox News": "http://feeds.foxnews.com/foxnews/latest",
"USA Today": "http://rssfeeds.usatoday.com/usatoday-NewsTopStories",
"TIME": "https://time.com/feed/",
"The Verge": "https://www.theverge.com/rss/index.xml",
"TechCrunch": "http://feeds.feedburner.com/TechCrunch/"
}

This works well, but I’m honestly still doing a lot of work that I could pass on to OpenAI. Why not simply ask it to find the “latest outrage” to have my bot post? One thing I’ve learned is that sex sells, but hate, violence, and outrage sells a lot more. People want a story to get riled up about, but right now my bot might post that but it also might post an article about a new tupperware set it found.

I also need to get this thing deployed in AWS. Right now it’s just running locally, which is not very good for demonstrating my CI/CD skills. This probably needs to be a priority.

Author

John Liberty

Posted on

2025-06-27

Updated on

2025-07-14

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.