Code Monkey home page Code Monkey logo

mst3k-quoter's Introduction

mst3k-quoter

A small project created for an Atl-Clj lightning talk, demonstrating the wonders of immutant.

It comes from a simple problem: how can one get a random quote from Mystery Science Theater 3000 on demand?

The solution was "live coded" in a short, 15-minute talk (with only the most cursory glances at the pre-written code cheat sheets that took an hour and half to prepare) at the Atl-Clj group, and is presented here for the enlightenment of all.

This project demonstrates just two of the numerous wonderful features of immutant: web handlers, and messaging. The front end application "webber" creates an immutant web endpoint, and communicates with the back end quotes data source "quoter" using immutant request/respond synchronish messaging.

How to Make It Go

  • Install immutant by following the super easy installation directions
  • Deploy both of the apps, by running these commands from the project root:
lein immutant deploy ./webber
lein immutant deploy ./quoter
  • Start immutant
lein immutant run
  • Point your browser at http:/localhost:8080 and enjoy an unlimited supply of quotes from the greatest TV show of all time.

What's Going On Here?

Quoter loads up the WikiQuote MST3K page and then pulls out all the quotes using enlive - the quote page helpfully puts all the quotes in <dl> tags making it easy for to get them with an enlive selector. It picks one at random each time Webber asks for a quote and sends it across immutant messaging.

Acknowledgements

Thanks to the Atl-Clj Group, Jim Crossley, and Chap Lovejoy!

mst3k-quoter's People

Contributors

mgaare avatar

Watchers

James Cloos avatar Roma Chi 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.