Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


National Novel Generation Month.

A script to automatically generate a 50,000-word "novel" during November, as an alternative to writing it. Based on an idea by Github user dariusk co-ordinated here.

My script automatically scrapes user-submitted stories from, mashes them together and remixes them into something almost entirely devoid of meaning.

You can see an example of what it generates at


  • Only two files are important: nanogenmo.rb and story.erb. Download them, or clone the repo, whatever you feel like.

  • You will need the nokogiri and redcarpet gems installed. These require native extensions, which can be a pain in the arse on some platforms. Google it if you have problems.

  • Edit nanogenmo.rb in your choice of editor, and look at the configuration options at the top. You'll want to set INDEX_URLS to an array of index page URLs that you want to generate your story from. Some examples are given, and you can use as many as you like.

  • Other configuration options are provided with comments. You may want to generate a story of a different length (WORD_GOAL), create a larger data set (MAX_PAGES), etc.

  • Run the script using ruby nanogenmo.rb. Depending on your options, connection speed and the whim of the servers, this may take a long time.

  • Your story will be saved to (Markdown format) and story.html (HTML format).

  • Read and enjoy!

  • If you have run the script previously, you will have a cache.yaml file saved which contains all the data scraped from If you want to tweak the story generation parameters but use the same data set (saving a shitload of time) you can set FETCH_LIVE_DATA = false in the script.


  • What kind of stories does this generate?
    It's from a dystopian future where Bayesian poisoning spammers hawk My Little Pony / Sonic the Hedgehog fanfiction written by confused 12-year-olds.
  • So it's completely unintelligible?
    The source material is Garbage in, garbage out. (Only joking :)
  • Will I see adult content?
    Depends which index page you give it to work with. I think bans NC-17 material, so it's probably not going to be too graphic.
  • Do the generated stories infringe copyright?
    Maybe? If you're considering publishing the output of this script, you have more important problems than copyright. I recommend the services of a mental health professional.
  • Does running this violate's Terms of Service?
    Yep. If you're an actual user you probably want to log out before running this. I take no responsibility if you get banned.
  • The generated text is full of weird half-sentences, what gives?
    The regular expression parser assumes the authors have a proper grasp of punctuation and grammar. Regrettably this is not always the case.
  • Why is some of it in a foreign language?
    NaNoGenMo doesn't discriminate, man! It just uses the stories you point it at. If you only want English, make sure the stories on the page you run the script on are all in English. If your language tastes lie elsewhere, you can use's advanced search to fetch stories in any language you like, and use that as the input.
  • What's the best combination of sentences you've seen it add to a story?
    "Rose, stop. We can't do another fight like this."
    "No. I think I have a lifetime spanner ban," she said ruefully.
  • The darkest?
    "Bella it's either your dad or abortion" he said.
    "Why not? I mean, other than for my pleasures."
  • And the best auto-generated title?
    Chapter 5. Should we go make sure Kari and my mum haven't killed each other?


National Novel Generation Month. A script to automatically generate a 50,000-word "novel" during November, as an alternative to writing it.







No releases published


No packages published