import cvUtils from './lib/cvUtils';
import mailUtils from './lib/mailUtils';
mailUtils.onMailArrived((mail) => {
// Rule No.1: No acient skills!
if (mail.content.match(/Dreamweaver|DIV\+CSS|Swiper|AJAX|Bootstrap/i)) {
return mailUtils.reply(mail.from, 'false');
}
// Rule No.2: Skills required
const skills = cvUtils.extractSkills(mail.content);
let skillPoints = 0;
['es6', 'babel', 'webpack', 'gulp', 'grunt', 'react', 'vue'].forEach(
(skill) => {
if (skills.indexOf(skill)) {
skillPoints += 1;
}
}
);
if (skillPoints < 2) {
return mailUtils.reply(mail.from, 'false');
}
// Rule No.3: Must have a github account
if (!mail.content.match(/github\.com/)) {
return mailUtils.reply(mail.from, 'false');
}
// Rule No.4: Prefered skills
['创业', 'ReactNative', '研究.*(框架|工具库).*源码', '设计.*前端架构'].forEach(
(skill) => {
if (mail.content.match(new RegExp(`${skill}`, 'i'))) {
skillPoints += 5;
}
}
);
const forwardMailbox = skillPoints > 10 ?
mailUtils.MAILBOX_PASSED_EXCELLENT : mailUtils.MAILBOX_PASSED;
mailUtils.reply(mail.from, 'true');
return mailUtils.forward(mail, forwardMailbox);
});
调用此接口请发简历至: chengliu@sohu-inc.com
邮件回复说明:
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.