Giter Site home page Giter Site logo

hsnews's Introduction

hsnews

A Hacker News clone written in Clojure using Noir.

Created for Hacker School batch[2].

Example

A live version is viewable at http://news.hackerschool.com. Login on this site is restricted to Hacker School students and alumni.

Usage

First install leiningen

brew install leiningen

Clone this repository and run

lein deps
lein ring server

By default, new user registration is disabled. If you want to enable user registration, uncomment the relevant lines in src/hsnews/views/common.clj and src/hsnews/views/user.clj.

Deployment

Deployment specific code for dotcloud is included in src/hsnews/db.clj to load environment variables. If a DOTCLOUD_DATA_MONGODB_URL variable isn't present, then the site falls back to using a local mongodb database.

There is also the ability to use an external server for authentication. By default, users are authenticaed against the local database. If an AUTH_URL environment variable is present then that URL will be used for authentication.

License

Copyright (C) 2012 Hacker School

Distributed under the terms of the AGPL

hsnews's People

Contributors

brendannee avatar nicholasbs avatar workmajj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hsnews's Issues

Host URL cannot be nil

the URL that causes the error: http://localhost:3000/sessions/create

java.lang.IllegalArgumentException: Host URL cannot be nil
at clj_http.client$post.doInvoke(client.clj:442)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at hsnews.models.user$login_BANG_.invoke(user.clj:82)
at hsnews.views.user$POST__sessions__create.invoke(user.clj:65)
at hsnews.views.user$eval3999$fn__4000.invoke(user.clj:63)
at compojure.core$if_route$fn__1135.invoke(core.clj:39)
at compojure.core$if_method$fn__1128.invoke(core.clj:24)
at compojure.core$routing$fn__1154.invoke(core.clj:98)
at clojure.core$some.invoke(core.clj:2388)
at compojure.core$routing.doInvoke(core.clj:98)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:602)
at compojure.core$routes$fn__1158.invoke(core.clj:103)
at noir.request$wrap_request_map$fn__1967.invoke(request.clj:14)
at ring.middleware.keyword_params$wrap_keyword_params$fn__1290.invoke(keyword_params.clj:21)
at ring.middleware.nested_params$wrap_nested_params$fn__1332.invoke(nested_params.clj:64)
at ring.middleware.params$wrap_params$fn__1262.invoke(params.clj:76)
at ring.middleware.multipart_params$wrap_multipart_params$fn__1370.invoke(multipart_params.clj:102)
at ring.middleware.session$wrap_session$fn__1555.invoke(session.clj:40)
at ring.middleware.cookies$wrap_cookies$fn__1467.invoke(cookies.clj:132)
at noir.server.handler$wrap_base_url$fn__2031.invoke(handler.clj:38)
at noir.session$noir_session$fn__1986.invoke(session.clj:58)
at ring.middleware.session$wrap_session$fn__1555.invoke(session.clj:40)
at ring.middleware.cookies$wrap_cookies$fn__1467.invoke(cookies.clj:132)
at noir.cookies$noir_cookies$fn__1892.invoke(cookies.clj:66)
at ring.middleware.cookies$wrap_cookies$fn__1467.invoke(cookies.clj:132)
at noir.validation$wrap_noir_validation$fn__2018.invoke(validation.clj:88)
at noir.statuses$wrap_status_pages$fn__1924.invoke(statuses.clj:23)
at noir.server.handler$wrap_url_decode$fn__2027.invoke(handler.clj:27)
at noir.exception$wrap_exceptions$fn__1955.invoke(exception.clj:59)
at noir.options$wrap_options$fn__1913.invoke(options.clj:34)
at clojure.lang.Var.invoke(Var.java:401)
at ring.middleware.stacktrace$wrap_stacktrace_log$fn__576.invoke(stacktrace.clj:15)
at ring.middleware.stacktrace$wrap_stacktrace_web$fn__608.invoke(stacktrace.clj:79)
at ring.middleware.reload$wrap_reload$fn__749.invoke(reload.clj:18)
at ring.adapter.jetty$proxy_handler$fn__87.invoke(jetty.clj:16)
at ring.adapter.jetty.proxy$org.mortbay.jetty.handler.AbstractHandler$0.handle(Unknown Source)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Self Posts

Self posts are one of the best features of HN.

HSN API

I've already got some fun ideas for things to do with the API, and I imagine others do as well.

Edit Posts/Comments

This might be two feature requests, but I don't want to open that many issues at once.

It would be great if you could edit Post titles/URLs and Comment text.

Validate submitted URLs

I think this could go either way, but it might be nice to do some basic validation on urls or automatically add "http://" or at least warn users when they are about to submit a relative link (if you think that will be a common thing).

Slow like a banshee

Looks like it is loading super slowly, on a heroku instance that needs to spin up or what?

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.