Giter Site home page Giter Site logo

godtributes's Introduction

godtributes

This is the source for @godtributes, a Twitter bot that posts tweets in the format:

SOMETHING FOR THE SOMETHING GOD

It will also occasionally reply to followers in the same way, using words they've said.

It runs on Node and uses the excellent twit module to interact with Twitter.

Warning: For now, it depends on the stable branch of level-cache-server running on the machine and will have problems with master.

Installation

git clone [email protected]:jimkang/godtributes.git
npm install

Then, create a config.js file in the project root that contains your Twitter API keys and your Wordnik API key. Example:

module.exports = {
  twitter: {
    consumer_key: 'asdfkljqwerjasdfalpsdfjas',
    consumer_secret: 'asdfasdjfbkjqwhbefubvskjhfbgasdjfhgaksjdhfgaksdxvc',
    access_token: '9999999999-zxcvkljhpoiuqwerkjhmnb,mnzxcvasdklfhwer',
    access_token_secret: 'opoijkljsadfbzxcnvkmokwertlknfgmoskdfgossodrh'
  },
  wordnikAPIKey: 'mkomniojnnuibiybvuytvutrctrxezewarewetxyfcftvuhbg'
};

Set up an instance of level-cache-server in a parallel directory.

Optionally, set up a cron job for run maketributes.js and/or exhort.js periodically.

Usage

To post a tribute ([something] FOR THE [something] GOD) tweet, run the commmand:

node maketribute.js

To make a tribute and print it to the console, but not post it:

node maketribute.js --simulate

To make tribute replies to followers:

node exhort.js

To make tributes for followers and print them to the console, but not post them:

node exhort.js --simulate

Blacklisting

godtributes now uses iscool's blacklists. If you'd like to add to them, make an issue or PR there.

Tests

Run tests with make test.

Structure

maketribute.js is the script that makes tributes. It uses wordniksource to get topics for the tributes, figurepicker for the figures of the tributes, and tributedemander to construct the tributes.

wordniksource is an adapter for the Wordnik API. It makes calls to Wordnik to get random words, find word frequencies, and get parts of speech.

tributedemander puts together the "[something] FOR THE [something]" strings. It uses canonicalizer to get the proper forms of the topic and figure words involved.

canonicalizer figures out if a word is singular, plural, or possessive (largely using the inflection module), then generates non-possessive singular and plural forms.

figurepicker rolls on a RPG-style table to generate figures for tribute. The main tribute figure has a 75% chance of being 'GOD'.

exhort.js is the script that gets the followers of @godtributes, decides whether to tweet at them, then comes up with a tribute to tweet at them. It uses all of the above modules, plus nounfinder to find interesting nouns within a follower's tweet and chronicler to keep track of what it's already done.

nounfinder uses a few internal rules and wordniksource for parts of speech and frequency to decide what words are interesting nouns.

chronicler uses a LevelDB database (via basicset-levelwrap) to track which tweets have been replied to and when a user was last replied to.

License

MIT.

godtributes's People

Contributors

jimkang 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.