Skip to content

Commit

Permalink
Add all stops as json
Browse files Browse the repository at this point in the history
  • Loading branch information
gudmundur committed Mar 23, 2013
1 parent 0675dc4 commit 0c718f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.coffee
Expand Up @@ -5,10 +5,15 @@ _ = require 'underscore'
glob = require 'glob'

timetable = require './lib/timetable'
stops = require './lib/stops'

glob 'schedules/**.csv', (err, files) ->
(_ files).each (file) ->
stream = fs.createReadStream file

timetable stream, (err, data) ->
fs.writeFileSync "timetables/#{path.basename file, '.csv'}.json", JSON.stringify data

stops.importDefault (err, stops) ->
data = JSON.stringify (stop for id, stop of stops)
fs.writeFileSync 'stops/allStops.json', data
1 change: 1 addition & 0 deletions stops/allStops.json

Large diffs are not rendered by default.

0 comments on commit 0c718f1

Please sign in to comment.