当前位置: 首页 > 后端技术 > Node.js

Techweekly:简单且高度可配置的技术周报邮件推送工具

时间:2023-04-03 13:16:25 Node.js

项目地址:https://github.com/xiongwilee/Techweekly快速入门第一步,下载代码,安装依赖:$gitclonehttps://github.com/xiongwilee/Techweekly.git$cdTechweekly&&npminstall--registry=https://registry.npm.taobao.org第二步修改邮件配置config/config.mail.js:module.exports={"sender":{"host":"mailserverhost","port":"邮件服务器端口号","auth":{"user":"邮箱地址","pass":"邮箱密码"}},"subject":"邮件主题","from":"你的name","to":["recipient'se-mailaddress"]}或者,可以直接使用默认的邮件配置config.mail.sample.js,修改config.mail.sample.js为config第三步.mail.js每周发邮件:$nodeindex.js仅供参考:如果需要定时发邮件,建议使用crontab:*10**5cd/your/project/path/&&nodeindex.js贡献给Techweekly默认支持fex和75team两种默认的周报来源,你可以根据自己的需要配置周报来源:"SourceID(可以配置任意字符)":{/***页面链接,可以是字符串也可以是函数,如果是函数:*@return{String}页面的URL*/url:function(){},/***获取URL的方法通过url获取的文章内容*@param{string}html通过页面连接爬取到的页面html*@return{String}从html中解析出的文章内容链接*/getLink:function(html){},/***通过文章内容的链接爬取到文章正文*@param{String}html通过文章内容的链接爬取文章的html*@return{String}文章正文部分html*/getContent:function(html){}}仅供参考:在getLink和getContent方法中,可以直接使用cheerio解析DOM。作者xiongwilee