 moment = require 'moment'
 _ = require 'lodash'
 changeCase = require 'change-case'
+assert = require 'assert'
 
 # Configure server instance
 server = Oriento require './.orientdb-connection.json'

  twitter = new Twitter require './.twitter-auth.json'
  stream = twitter.stream 'statuses/filter', track: '#apple'

  # Specify index
  tagsIndex = db.index.get('VTag.name')

  # Create event responder
  events = new EventEmitter




#
# Converts data to Twitter model object
#
tweetModel = (data) ->
  # Construct Tweet model
  '@class': 'VTweet'
  text:       data.text
  createdAt:  moment.utc(new Date data.created_at).format 'YYYY-MM-DD HH:mm:ss'
  inReplyTo:  getInReplyTo data
  data:       _.omit data, isExcludedTweetField


#
# Converts data to Twitter user model object
#
# assert.deepEqual {'@class': 'VUser', aA: 1, bB: 2}, userModel {a_a: 1, b_b: 2}
#
userModel = (data) ->
  camelCased = _.zipObject ([changeCase.camelCase(key), value] for key, value of data)
  _.merge {'@class': 'VUser'}, camelCased


# Play with database
