Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (18 sloc) 0.749 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: judge.id }, (err, count) ->
throw err if err
if count is 0
util.log "Sending 'judge_nag_one' to '#{judge.email}' (#{count})".yellow
postageapp.apiCall judge.email, 'judge_nag_one', null, null,
id: judge.id
first_name: judge.name.split(/\s/)[0]
else util.log "Skipping '#{judge.email}' (#{count})"
Jump to Line
Something went wrong with that request. Please try again.