Crest
17 Aug 2024

Diplomacy Today: A backstabbr and AI powered newspaper

Diplomacy Today is a python program and corresponding flask application that serves and hosts an early-twentieth-century-style newspapers generated from the turn orders of a game of Diplomacy hosted on backstabbr. The idea, and a large portion of the core code, are not my work, and I deserve none of the credit for it. But the original program seems to have been abandoned last year, and was perhaps only used for one game. But that is the beauty of free software, I have taken nraw’s original code and iterated upon it over the course of, so far, four games. It now contains more features and improved polish that builds upon the basic functionality of a GAI generated in-universe newspaper. I attempted to rewrite the program in chez scheme as a learning exercise, but ended up not using it as python has some nice libraries that I couldn’t bother to reimplement in scheme.

To use it you should:

  1. Make sure Mozilla Firefox is installed.
  2. Clone the Github repository:
git clone https://github.com/JanJoar/diplomacy_today.git
cd diplomacy_today
  1. Install all the python packages:
pip install -r requirements.txt
  1. Get your OpenAI API key and export it to the OPENAI_API_KEY environment variable.
  2. Generate the newspaper:
python3 main.py
  1. Run the web application using something like gunicorn:
gunicorn -b 0.0.0.0:1914 app:app

If you have any issues with installation or want to features, feel free to contact me, preferably at my email at joarxpablo@pm.me so that I can improve the program.

Tags: technology:
Other posts