Git Product home page Git Product logo

midsomerplots-content's Introduction

MidsomerPlots content

This is a Midsomer Murders plot generator, available as a Node.js package and as an open web API, as used in the @midsomerplots Twitter bot (code) and Alexa skill (code)

Use as a Node.js module:

const midsomerplots = require('midsomerplots-content');

// need to pass a seed = an integer, here just the time
midsomerplots.generate(Math.round((new Date()).getTime()/1000));

Web API

curl "https://midsomerplots.acrossthecloud.net/plot?seed=n"

for some 32-bit integer n (if ommitted, will default to current Unix time in seconds)

Example response:

{
  "plot": "A misunderstood Scottish flight attendant is found killed in a model village and tied down like Gulliver in Lilliput. Suspicion falls on Upton Snodsbury’s real ale appreciation society, confused that the local date night might threaten to reveal that due to an off-by-one error, the meaning of life is actually 43.",
  "seed": 13
}

Alternatively, a maximum character limit may be passed:

curl "https://midsomerplots.acrossthecloud.net/plot?characterLimit=200"

Note that this is incompatible with the seed querystring parameter, and for low numbers introduces a delay or even the possibility of a timeout (after 30s) while it finds a short enough plot at random.

midsomerplots-content's People

Contributors

dependabot[bot] avatar happyeinara avatar jeamland avatar matthewberryman 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.