Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fd6770efe7
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (19 sloc) 0.842 kb
require 'colors'
env = require '../config/env'
mongoose = require('../models')(env.mongo_url)
util = require 'util'
postageapp = require('postageapp')(env.secrets.postageapp)
Vote = mongoose.model 'Vote'
Person = mongoose.model 'Person'
Person.find { role: 'judge', email: /@/, twitterScreenName: /\w/ }, (err, judges) ->
throw err if err
judges.forEach (judge) ->
Vote.count { personId: }, (err, count) ->
throw err if err
votes_left = 10 - count
if votes_left > 0
util.log "Sending 'judge_nag_two' to '#{}' (#{count})".yellow
postageapp.apiCall, 'judge_nag_two', null, null,
votes_left: if votes_left is 1 then '1 vote' else "#{votes_left} votes"
else util.log "Skipping '#{}' (#{count})"
Jump to Line
Something went wrong with that request. Please try again.