Skip to content

Instantly share code, notes, and snippets.

@mikerr
Created April 20, 2018 21:02
Show Gist options
  • Select an option

  • Save mikerr/086feee87b04ba37c5a471a7c0313c3d to your computer and use it in GitHub Desktop.

Select an option

Save mikerr/086feee87b04ba37c5a471a7c0313c3d to your computer and use it in GitHub Desktop.

Revisions

  1. mikerr created this gist Apr 20, 2018.
    12 changes: 12 additions & 0 deletions gmail.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash

    username="USERNAME"
    password="PASSWORD"
    echo
    curl -u $username:$password --silent "https://mail.google.com/mail/feed/atom" | grep -oPm1 "(?<=<summary>)[^<]+"

    # title = email subject
    # summary = body of message
    # name = sender name
    # email = sender email
    # issued = date sent