Code Monkey home page Code Monkey logo

mozerablebot's Introduction

You were looking for a bot, and then you found a bot.

Use

This repo has the stuff you need to run the bot on Red Hat's OpenShift infrastructure. Most of the files in this repo are from rhc default project setup. I used a gear with a Python 3.3 and Cron cartridge.

The meat of the bot itself is in tweet.py. This assembles and tweets the tweet each time it's called. This assumes you have some kind of infrastructure, like a cron job, to regularly call the script.

I may be constructing my Wordnik API calls incorrectly, because I sometimes see plural words leaking through. Until I figure it out, I'm using the inflect library to convert plural nouns to singular ones. I had to manually install inflect on my OpenShift instance by sshing in and running pip; your mileage may vary there.

The cron script that runs the bot is in .openshift/cron/minutely/tweet.sh. It's called every minute by virtue of being in .openshift/cron/minutely. This is what determines how often the tweeting script is called. It should be called about 5 times per day, as per the modulo in the if condition. I may change how this frequency is calculated in the future, but it's fine for now, right? Right.

Acknowledgments

Uses the badwords list from Darius Kazemi's wordfilter library. I welcome any reports of racist, sexist, ablist, transphobic, etc. language as GitHub issues or over Twitter.

Profile image from The Guardian.

mozerablebot's People

Contributors

mambocab avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

mozerablebot's Issues

fix singularity

Yes, the bot is sentient

No, false. Singularness. That's the problem. As I said on twitter, 10 bucks says this is a bs singularization of 'fetus':

https://twitter.com/mozerablebot/status/547228363275124736

So, resolved: I need to file a bug report/PR with inflect. Then I need to figure out whatever the heck is wrong with the way I'm grabbing stuff from Wordnik.

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.