[ANN] gmailer 0.0.1 (plain text)

Some API suggestions:

First, get rid of camel case! That, or at least provide aliases, e.g.
gmail.fetch_box vs gmail.fetchBox.

Second, since you must call setLoginInfo in order to do just about
anything, then I would recommend allowing users to pass that information
to the constructor as a shortcut. So, your constructor would look like
this:

def initialize(name, password, charset='UTF-8')
   ...
   setLoginInfo(name, password)
end

Let's folks skip a step. :slight_smile:

Regards,

Dan

PS - I'll post these suggestions on the project page as well.

···

-----Original Message-----
From: Park Heesob [mailto:phasis@bcline.com]
Sent: Tuesday, August 16, 2005 8:01 AM
To: ruby-talk ML
Subject: [ANN] gmailer 0.0.1 (plain text)

Hi,

Sorry for previous encoding message.

I'm happy to announce first version of GMailer, a class for
interface to
Google's webmail service.

You can fetching gmails

   require "gmailer"

   gmail = GMailer.new
   gmail.setLoginInfo(name, pwd)
   if gmail.connect
      gmail.fetchBox(GM_LABEL, "my_label", 0)
      snapshot = gmail.getSnapshot(GM_LABEL)
      if snapshot
         puts "Total # of conversations of my_label = " +
snapshot.box_total.to_s

      end
      gmail.disconnect
   end

Sending new gmails

   require "gmailer"

   gmail = GMailer.new
   gmail.setLoginInfo(name, pwd)
   if gmail.connect
      to = "who@what.com, my_friend@his_company.com, god@heaven.org"
      cc = "foo@bar.com"
      subj = "Hello There!"
      message = "Hi...\n\nBlah blah blah~..."
      attachments = ["./my_pic.jpg", "./my_cv.txt"]
      gmail.send(to, subj, message, cc, '','', '',
attachments, false, '')
   end

Or playing around with contact list

   require "gmailer"

   gmail = GMailer.new
   gmail.setLoginInfo(name, pwd)
   if gmail.connect
      gmail.fetchBox(GM_CONTACT, "freq", 0)
      snapshot = gmail.getSnapshot(GM_CONTACT)
      puts "Your frequently used addresses:"
      snapshot.contacts.each { |item|
         puts "Name: " + item["name"] + ", Email: " + item["email"]
      }
   end

You can find out more about GMailer at:

http://rubyforge.org/projects/gmailutils

Hi,

From: "Berger, Daniel" <Daniel.Berger@qwest.com>
Reply-To: ruby-talk@ruby-lang.org
To: ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Re: [ANN] gmailer 0.0.1 (plain text)
Date: Tue, 16 Aug 2005 23:27:16 +0900

Some API suggestions:

First, get rid of camel case! That, or at least provide aliases, e.g.
gmail.fetch_box vs gmail.fetchBox.

Second, since you must call setLoginInfo in order to do just about
anything, then I would recommend allowing users to pass that information
to the constructor as a shortcut. So, your constructor would look like
this:

def initialize(name, password, charset='UTF-8')
   ...
   setLoginInfo(name, password)
end

Let's folks skip a step. :slight_smile:

Regards,

Dan

I accepted your suggestions:)

You can use either camel case name or _ style name(ex:fetchBox or fetch_box)

also you can initialize gmailer with login info
  gmail = GMailer.new(name,pwd,charset='UTF-8')

Regards,

Park Heesob

Does it handle access via proxy?

Hi,

From: Lyndon Samson
Reply-To: ruby-talk@ruby-lang.org
To: ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Re: [ANN] gmailer 0.0.1 (plain text)
Date: Wed, 17 Aug 2005 10:07:55 +0900

Does it handle access via proxy?

Not yet.

But it is pure ruby and uses net/http module.

I cannot test proxy related code because I have no proxy server.

If anyone can handle access proxy server, make a patch to work for proxy server please.

Regards,

Park Heesob