Results 1 to 2 of 2

Thread: CLI Gmail Checker?

  1. #1
    Join Date
    Oct 2008
    Beans
    158
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    CLI Gmail Checker?

    Does anyone know of a python/shell script/application that would allow me to check if I have any emails from the command line? So I would type something like "gmailchecker" and it would say "You have 5 new emails..."

    Any help would be appreciated.
    √ is /

  2. #2
    Join Date
    Nov 2007
    Beans
    450

    Re: CLI Gmail Checker?

    this is a script I use to check my imap accounts in conky, but it also works in the terminal.

    #! /usr/bin/env ruby
    # by Ardanwen

    require "net/imap"

    imap = Net::IMAP.new("imap.gmail.com","993","true")
    imap.login("username","password")
    imap.select("Inbox")
    value = imap.search(["NOT","SEEN"])
    if value.empty? == false
    printf "#{value.nitems}"
    else
    printf "0"
    end
    imap.disconnect
    I called this file gmail.rb. Then youjust have to run the file.

    Code:
    ruby gmail.rb
    For it to run, you need to install ruby you can find it in synaptic.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •