开发者

RSS+SSL (gmail) via command line?

开发者 https://www.devze.com 2023-04-01 23:06 出处:网络
My goal is to be able to read new messages from a gmail account via a linux server. I guess I could do this via IM开发者_运维问答AP or something, but I\'d like to avoid that complexity if possible giv

My goal is to be able to read new messages from a gmail account via a linux server. I guess I could do this via IM开发者_运维问答AP or something, but I'd like to avoid that complexity if possible given that gmail has this nice feed set up:

https://mail.google.com/mail/feed/atom/

The only issue is that I'm not sure how to authenticate the call to pull this. Is this possible?


A good starting point should be:

curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 - \1/p"

Checks the Gmail ATOM feed for your account, parses it and outputs a list of unread messages.

Also, see this thread: http://www.commandlinefu.com/commands/view/3380/check-your-unread-gmail-from-the-command-line

OTOH, I would recommend using mutt and IMAP.

0

精彩评论

暂无评论...
验证码 换一张
取 消