Skip to content

dansumption/deitygalaxybot

Repository files navigation

All The Deities

Deity Galaxy bot - @deitygalaxybot is a Twitter bot based on a Tracery grammar. It tweets every few hours (usually), replies to mentions, and tries to remember which deity's tweet you've replied to so that it can again reference that deity.

I'd would love to receive contributions to the grammar - the stuff that makes up the stuff the bots say. If you'd like to help, just fork this repository, start making changes, and then submit a pull request. I've started adding Issues to this repo - feel free to check them out and work on them, but you may first want to read on and have a play around...

File structure

All of deitygalaxybot's text is stored in the grammar directory.

  • story.js contains the sentence templates for everything that the bot writes - think of these as a series of mini stories involving deities. I would be very grateful to anyone who could add some more! You'll find some more story elements scattered around in the stories directory - this is mostly old stuff that I've been meaning to move elsewhere.
  • The other top-level files you shouldn't need to worry about much.
    • index.js is the first file loaded, and pulls in all of the vocabulary for the bot - nouns, verbs, names, places, times, ..
    • origin.js isn't much used - but it decides on different templates based upon whether this is a fresh tweet, or a reply to someone.
    • hashtag.js, macros.js, writing.js - ignore them for now.
  • The various subdirectories contain all of the different categories of words - so the nouns directory contans nouns split into dozens of different categories, spacetime contains places (building types, places of worship, names of real and imaginary countries, towns, mountains, buildings...), times ('40 winks', 'the time it takes for a watched kettle to boil',...) and more. actors is where deities, humans and animals get their names, professions, and pronouns. adjectives and adverbs should be mostly self-explanatory

Tracery allows for nested grammar - and there are quite a few places where you can see this in action.

  • For example, in festival.js, the following template: "start of filming of the BBC series '#nounToPluralise.capitalizeAll#' #deityPlace#" will be filled in randomly each time the script is run, to come up with variations like:
    • start of filming of the BBC series 'Fucking Meerkat' on Flesh Hovel Lane
    • start of filming of the BBC series 'Fatberg' in an eroded range of hills
    • start of filming of the BBC series 'Cornish Pastie' on the Orient Express
  • Take a look at name.js to see how grammar can be embedded and smooshed around to come up with deity-like names such as Weh or Æz or Phu'buxmie-iest or Ioqu'thor or Clieseph.
  • My favourite daft detail in the whole lot is the bird name generator. Have a peek in birds.js if you want to see how "#adjective#-#birdBodyPlace# #birdAdjective# #birdType#" gets converted to breeds like...
    • irridium-breasted mountain blackbird
    • fruity-capped interstellar chough
    • ringed-crowned emperor shag
    • perky-headed wood quail
    • virgin-legged space swift

Grammar conventions

Nouns

Nouns are a bit of a mess at the moment. Here is an attempt at a summary:

  • #nounToPluralise# can be used bare, with "a/an" in front, of as a plural. These nouns include body parts, animals, birds, clothing (only singular clothes included), computer objects, "game of " games, days, food items, misc objects, flowers, trees, vehicles, weapons, relatives
  • #nounNotToPluralise are abstract or group nouns, including abstract nouns, academic fields, bands, actions, beliefs, building materials, collective nouns, disorders, feelings, famous people, food stuffs, games, institutions, liquids, new technologies, qualities, euphemisms.
  • #anyNoun# can be either type above
  • #singleNoun# can be either type above, but #nounToPluralise# will be preceded by "a" or "an";

Testing/debugging

You don't need to test your new grammar before submitting it to me, but it will help if you do. To do so requires installing and running the bot software. Here's how...

Testing grammar

To get started, create a temp directory and then run npm run debug (you'll need npm installed) - it will spit out a file temp\debug.txt with a lot of sample generated tweets in it. To alter the template used, checkout debug.js, and to really go deep, look at the files contained within the grammar directory - see above.

Testing twitter

The twitter side of things is a little more complex, and I'm leaving details out for now. I hosted deitygalaxybot's grammar initially on Cheap Bots, Done Quick, but as the things I wanted to do with it grew (and my grammar JSON grew out of control) I built this version so I could host it myself on Heroku. I found this tutorial super helpful.

About

Bot for @deitygalaxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published