Skip to content

Instantly share code, notes, and snippets.

@TerryMooreII
Created September 24, 2012 00:31
Show Gist options
  • Save TerryMooreII/3773575 to your computer and use it in GitHub Desktop.
Save TerryMooreII/3773575 to your computer and use it in GitHub Desktop.
Check Gmail from Bash with Perl
#!/bin/bash
curl -u motersho@gmail.com --silent "https://mail.google.com/mail/feed/atom" |
perl -ne \
'
print "SUBJECT: $1 \n" if /<title>(.+?)<\/title>/;
print "RECEIVED $1 \n" if /<issued>(.+?)<\/issued>/;
print "FROM: $1 " if /<name>(.+?)<\/name>/;
print "($1)\n\n" if /<email>(.+?)<\/email>/;
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment