Code Monkey home page Code Monkey logo

news_watch_notice's Introduction

爬取GoCn每日新闻go语言中文网(每日资讯)Gopher Daily并推送到微信/邮箱/slack

image

2019-11-20-18-21-29

使用方法

通过微信通知
docker run -v /etc/localtime:/etc/localtime:ro \
-e NOTICE_WECHAT_USERS=特鲁尼克 hanyajun/news_watch_notice
  • NOTICE_WECHAT_USERS 代表你要通知的好友的昵称,其中自己微信的文件助手是默认会发的,如果有多个好友,以逗号","隔开。 image
效果

image

微信通知有个缺点,就是网页版微信只能有一个终端登录

通过微信公众平台(测试号)推送

访问 https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login 微信扫一扫开通并关注测试号,填写 appid 和 appsecret 运行即可在订阅号中找到该测试号推送的消息

docker run -d -v /etc/localtime:/etc/localtime:ro \
    -e NOTICE_TYPE=disable \
    -e WECHAT_PUSH=push \
    -e WECHAT_APP_ID=wxf123456789 \
    -e WECHAT_APP_SECRET=adcdefg123456789 \
    hanyajun/news_watch_notice
通过邮箱推送
docker run -v /etc/localtime:/etc/localtime:ro -e NOTICE_TYPE=mail \ //采用邮箱通知,不填则默认微信
-e [email protected],[email protected] \ //发送
-e NOTICE_MAIL_PWD=******* \ //邮箱smtp授权密码
-e NOTICE_MAIL_PORT=25 \  //smtp端口
-e NOTICE_MAIL_HOST=smtp.qq.com \ //smtp服务器地址
-e [email protected] \ //发送邮箱
-e [email protected],[email protected] //发送抄送 hanyajun/news_watch_notice
效果

image

2019-11-20-18-26-23

slack webhook 发送
docker run -d --name gocn-news-notice-slack -v /etc/localtime:/etc/localtime:ro \
-e NOTICE_TYPE=slack \ //采用slack webhook发送
-e NOTICE_SLACK_WEB_HOOK_URL=**************  //自己创建的slack app的webhook的url
hanyajun/news_watch_notice
效果

image

2019-11-20-18-18-48

news_watch_notice's People

Contributors

han-ya-jun avatar lanseyujie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

news_watch_notice's Issues

panic: 微信返回的数据有误

{
"BaseResponse": {
"Ret": 1,
"ErrMsg": ""
}
,
"Count": 0,
"ContactList": [],
"SyncKey": {
"Count": 0,
"List": []
}
,
"User": {
"Uin": 0,
"UserName": "",
"NickName": "",
"HeadImgUrl": "",
"RemarkName": "",
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"HideInputBarFlag": 0,
"StarFriend": 0,
"Sex": 0,
"Signature": "",
"AppAccountFlag": 0,
"VerifyFlag": 0,
"ContactFlag": 0,
"WebWxPluginSwitch": 0,
"HeadImgFlag": 0,
"SnsFlag": 0
}
,
"ChatSet": "",
"SKey": "",
"ClientVersion": 0,
"SystemTime": 0,
"GrayScale": 0,
"InviteStartCount": 0,
"MPSubscribeMsgCount": 0,
"MPSubscribeMsgList": [],
"ClickReportInterval": 0
}

panic: 微信返回的数据有误

goroutine 1 [running]:
news_watch_notice/utils.PanicErr(...)
/go/cache/utils/common_utils.go:33
news_watch_notice/pkg/wechat.WechatLogin(0xb0c662, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/cache/pkg/wechat/wechat.go:70 +0x856
main.main()
/go/cache/cmd/news_watch_notice.go:53 +0x1d69

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.