Created
August 31, 2012 21:01
-
-
Save djthread/3558936 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ loadConfigFile = (err, data) -> log.log "Reading Global Config File..." if err log.log 'db/config.json not found. starting new one..' else for key, val of JSON.parse data if config[key] != undefined then config[key] = val log.log "Loaded." log.log "" filesystem.readFile 'db/feeds.json', loadFeedsFile loadFeedsFile = (err, data) -> log.log "Reading feeds from file..." if err log.log 'db/data.json not found. starting new one..' return for feed in JSON.parse data items = [] for i in feed.items items.push = new FeedItem(i) feed.items = items feed.config = new FeedConfig(feed.config) feeds.push new Feed(feed) log.log "Loaded #{feeds.length} feeds" log.log "" filesystem.readFile 'db/config.json', loadConfigFile