Giter VIP home page Giter VIP logo

wildchild_wikipedia_bot's Introduction

TMNT Wikipedia Bot

Every 60 minutes this Python script posts to https://twitter.com/wiki_tmnt and https://botsin.space/@tmnt

Why

For fun! Inspired by https://xkcd.com/1412/

How

When it runs, it:

  • Pulls 10 random Wikipedia article titles
  • Checks if they are in trochaic tetrameter
    • If not, pull 10 more articles ad infinitum until a match is found
  • Create a faux-TMNT logo containing the wiki title
  • Post the title and generated logo to @wiki_tmnt on Twitter

Environment

This script requires the following:

  • Python >= 3.7
    • Earlier may work, only tested on 3.7
  • Chrome >= 57
  • Via PyPi:
    • pronouncing
    • num2words
    • PIL

For @wiki_tmnt it runs on a cron job on my local machine.

Configuration

I haven't defined a config file format yet, it's in the TODO list below. Common config knobs are currently mostly in lib/constants.py.

Caveats

I'm not developing this for anyone but myself, so you may see some anti-patterns like hardcoded paths specific to my environment, and general lack of configurability outside editing the source.

Given this runs once per hour, I'm not very concerned about performance. I often choose slow, but readable and easy-to-implement solutions.

TODO

TODO:

  • More docstrings
  • README
  • CLI arguments
  • use real file format for keys
  • refactor key fetching to be done once
  • Integration tests
  • more unit tests
  • actually enable option to run doctests
  • Run glench.com/tmnt locally

Super bonus points:

  • CI
  • Mastodon
  • zipapp release
  • archive posts locally
  • cache of titles : stresses

wildchild_wikipedia_bot's People

Contributors

catleeball avatar chriswhong avatar jbrew avatar jpf avatar

Watchers

 avatar

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.