GithubHelp home page GithubHelp logo

zeitgeisty's Introduction

Zeitgeisty

This is a bot that generates daily aphorisms from news headlines and social media commentary. It is based on an idea from the Oulipo for inventing aphorisms by using a computer to insert nouns and verbs into formulas. The bot finds words in a Word2Vec model constructed from the headlines and social media statuses. In this way it offers a zeitgeist that emerges from the Internet.

Check it out!

Setup

  1. Install Python 3.8 (as a virtual or Paas environment).
  2. Install the Python modules in requirements.txt.
  3. Create a docs subfolder. This is where content from headlines and social media (now only Mastodon) will be archived.
  4. Create an aphorisms subfolder. This is where lists of aphorisms will be archived.
  5. Create a hate_speech subfolder. This is where aphorisms classified as hateful are archived. These aphorisms are not shared publicly.
  6. Rename mastodon_credsTEMPLATE.py as mastodon_creds.py and supply your personal credentials.
  7. Run getDocsMastodon.py to download content from news headlines and Mastodon. I run this script twice a day (every twelve hours).
  8. Run pruneDocs.py to eventually delete news and social media content that is over 90 days old.
  9. Run buildModel.py to build the Word2Vec model from the archive in docs/.
  10. Run generateAphorisms.py for a list of around 200 aphorisms. The code is parameterized to generate a total of at least 50,000 words in 30 days for NaNoGenMo 2022.
  11. Run sendToots.py to share the aphorisms on Mastodon, one every 30 minutes.
  12. Here is a sample crontab file to automate things:
# IMPORTANT NOTE!
# Please make sure there is a blank line after the last cronjob entry.
0 2,14 * * * /your/path/to/Zeitgeisty/getDocsMastodon.py
30 2 * * * /your/path/to/Zeitgeisty/pruneDocs.py
0 3 * * * /your/path/to/Zeitgeisty/buildModel.py
0 4 * * * /your/path/to/Zeitgeisty/generateAphorisms.py
30 4 * * * /your/path/to/Zeitgeisty/sendToots.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.