Coder Social home page Coder Social logo

chancancode / hn-reader Goto Github PK

View Code? Open in Web Editor NEW
203.0 9.0 51.0 3.04 MB

An embitious Hacker News reader, built with Ember.js

Home Page: http://chancancode.github.io/hn-reader/about

License: MIT License

JavaScript 60.51% HTML 2.10% CSS 17.71% Handlebars 15.07% Ruby 4.62%

hn-reader's Introduction

Hn-reader

This README outlines the details of collaborating on this Ember application. A short introduction of this app could easily go here.

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone <repository-url> this repository
  • change into the new directory
  • npm install
  • bower install

Running / Development

Code Generators

Make use of the many generators for code, try ember help generate for more details

Running Tests

  • ember test
  • ember test --server

Building

  • ember build (development)
  • ember build --environment production (production)

Deploying

Specify what it takes to deploy your app.

Further Reading / Useful Links

hn-reader's People

Contributors

atsjj avatar chancancode avatar ember-tomster avatar jish avatar mischah avatar stefanpenner avatar tgxworld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

hn-reader's Issues

Shownew

I love the layout, but I like to read the shownew section, not just the show section. I don't see a link for it and if I try the direct url it takes me to the regular HN site.

Cannot find module 'walk-sync'

Following the instructions in the readme:

  • clone
  • npm install
  • bower install
  • ember server

https://github.com/chancancode/hn-reader#installation

I get the following output

edge/hn-reader[master]% ember server
version: 0.1.12
Cannot find module 'walk-sync'
Error: Cannot find module 'walk-sync'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/josh/code/js/edge/hn-reader/lib/fixtures-packer/lib/broccoli-packer.js:3:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Improve the fixtures

Let me explain the idea:

The app needs to fetch markup from the HN server and parse them into JSON. In order to prevent regressions in the parser, I have downloaded a bunch of HTML pages and put them in /tests/fixtures and froze the JSON output in there. So everytime I make changes to the parser, I can run the tests again and see the diff and decide if it's legit or not.

There's a in-repo add-on for making these fixtures available to the tests.

The HTML fixtures serves another purpose โ€“ there's a pretender server in /tests/helpers that serves these things to the integration tests. I hacked in an offline development mode (OFFLINE=1 ember server) which runs the dev server with the pretender thing enabled, so you can work on this without wifi.

I think these ideas are pretty great, but the implementations, not so much.

Problems:

  1. To make the fixtures available to the tests, I wrote this "fixture-packer" add-on (in lib). It was one of my first broccoli/add-on thing so the implementation is probably terrible. I also wrote a lot of features that I thought was cool but never used (import specificFixture from 'some/deeply/nested/thing' instead of justimport fixtures from 'all_the_things` and access it normally). I am pretty sure reading fixture files of some sort is a pretty common need, so we should either find something that already does this, or if that doesn't exists then improve/simplify/refactor the thing in there and extract it into a real add-on.
  2. The fixtures are huge! I think I am storing way too many of them (first 5 listing/index pages of each category/filter, then the individual item pages for the first 10 stories in each). They take up a lot of space too. And they make the repo size pretty big, because old fixtures stays in the git history too. (I think I nuked all of them at some point and re-downloaded them from HN, but the old ones are still stuck in the git history hell somewhere.)
  3. The process of updating the JSON fixtures is mega HAX. I'd empty out the JSON fixture files, run the tests (which would be failing of course) and extract actual result from the qunit reporter :P I guess what I really want is to be able to run the "extractors" as a standalone script, so after I downloaded new HTML fixtures, I can generate the JSON fixtures by run_that_extractor_somehow html_fixture.html > json_fixture.json.

Deploy script?

Either make this a script, or use grunt etc, or at least put it in the readme.

To build the chrome extension:

  1. CHROME=1 ember build -prod
  2. Go to chrome://extenstions and use the /chrome directory for either "Load unpacked extension" or "Build extension"

To build for github pages:

  1. ember build -prod
  2. Push the contents of /gh-pages to the gh-pages branch

cc @tgxworld in case you were wondering about this.

Error while processing route: stories.show.index

Can't se stories, got this error in the console:

Error while processing route: stories.show.index Cannot read property '_relationships' of null TypeError: Cannot read property '_relationships' of null

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.