GithubHelp home page GithubHelp logo

drama's Introduction

Clojure drama

A Clojure drama to play alone, in parallel or in group. The plot is in 3 acts :

  • Get some data from the web : here all plays and their characters of a famous writer
  • Question the data
  • Happy End : make a web site to present your results

This project intends to be a gentle way to dive into clojure ecosystem.

You maybe trained your clojure skills on some 4clojure problems but why not just start directly to do something real.

And on the way it will give you the feel of the clojure power : be declarative and concise, stay focused on data and functions.

cascalog , enlive , ring, moustache are the libraries used here.

But most of new comers see clojure as unusual and cryptic. Such expressions like [:div#main :ul :li [:a (h/attr= :href "/")]] or (<- [?name ?sum] (persons ?name ?amount) (co/sum ?amount :> ?sum)) are in fact a concise, elegant ways to express your logic.

This drama is an attempt to lower the entrance barrier of clojure and hope you will enjoy the simplicity of clojure as I do.

A html source transcript is also available http://maxrzepka.github.com/drama/doc.html and also screencasts act 1 act 2 act 3

Act 1 : Scraping with enlive

Fetch all plays of a famous writer along with their characters. Data coming from this web site .

You may consider my other project https://github.com/maxrzepka/clojure-by-example to play with enlive selectors available on heroku.

Act 2 : Querying with cascalog

No need to know Hadoop or map/reduce paradigms to play with cascalog. Just try it on the repl.

Act 3 : Back to the Web with ring, enlive and moustache

Building web app shoud be simple and with clojure it is.

Web app deployed on (cloudfoundry)[http://clj-drama.cloudfoundry.com/]

Usage

Clone it Fork it ... This project is a continuous work-in-progress. Feel free to use it as you like.

To launch the web app on localhost:8080 , just execute lein run

Your comments/questions/contributions are more than welcome.

drama's People

Contributors

maxrzepka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

drama's Issues

List of characters not displayed

In act 3 (drama.act3/routes {:uri "/Dom Juan" :request-method :get}) returns the correct HTML page with list of characters. When running in jetty no list displayed.
It seems that jetty doesn't wait for the cascalog query to finish.

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.