[ANN] gmailer-0.0.2

Discussion in 'Ruby' started by Park Heesob, Aug 20, 2005.

  1. Park Heesob

    Park Heesob Guest

    GMailer is a class for interface to Google's webmail service.

    It can fetch mails, save attachements, get cotact lists, invite someone
    or send message with file attachments. You can make GMail as an online
    backup system or as a virtual filesystem with this library.

    Now usage is very simple and compact like this:

    GMailer.connect(name,pwd) do |g|
    #fetch
    g.fetch:)label=>"my_label") {|snapshot|
    puts "Total # of conversations of my_label = " +
    snapshot.box_total.to_s
    }

    #get contact
    g.fetch:)contact=>"freq").each do |item|
    puts "Name: #{item['name']} Email: #{item['email']}"
    end

    #send
    g.send(
    :to => "",
    :subj => "Hello There!",
    :body => "Hi...\n\nBlah blah blah~...",
    :files => ["./test.txt"]
    )
    end

    Project:: http://rubyforge.org/projects/gmailutils/
    Bugs:: http://rubyforge.org/tracker/?group_id=869


    Regards,

    Park Heesob
     
    Park Heesob, Aug 20, 2005
    #1
    1. Advertising

  2. Re: gmailer-0.0.2

    Hi!

    Your library keeps getting cooler, the send() thing is especially
    interesting...

    I just wanted to add a note about
    naming_conventions() vs. namingConventions(). You could add

    def method_missing(sym, *args, &block)
    parts = sym.to_s.split("_"); throw NameError(sym) if parts.size < 2
    camel_case = parts[0]+(parts[1..-1].map(){|x| x.capitalize }).join()
    send(camel_case, *args, &block)
    end

    to the Gmailer class, and omit all aliases - it will autoforward
    messages named with _ to camelCased ones.
    (not sure if it is the RubyWay, though : )
     
    Konstantin Levinski, Aug 20, 2005
    #2
    1. Advertising

  3. Park Heesob

    James Britt Guest

    Park Heesob wrote:
    > GMailer is a class for interface to Google's webmail service.
    >
    > It can fetch mails, save attachements, get cotact lists, invite someone
    > or send message with file attachments. You can make GMail as an online
    > backup system or as a virtual filesystem with this library.
    >
    > Now usage is very simple and compact like this:
    >
    > GMailer.connect(name,pwd) do |g|
    > #fetch
    > g.fetch:)label=>"my_label") {|snapshot|
    > puts "Total # of conversations of my_label = " +
    > snapshot.box_total.to_s
    > }
    >


    Very, very nice.

    Do you have an example of reading an actual mail message?

    Once I have a snapshot, how I get to individual mail?


    Thanks,


    James
    --

    http://www.ruby-doc.org - The Ruby Documentation Site
    http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
    http://www.rubystuff.com - The Ruby Store for Ruby Stuff
    http://www.jamesbritt.com - Playing with Better Toys
     
    James Britt, Aug 24, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Park Heesob

    [ANN] gmailer 0.0.1 (plain text)

    Park Heesob, Aug 16, 2005, in forum: Ruby
    Replies:
    5
    Views:
    131
    Park Heesob
    Aug 19, 2005
  2. Park Heesob

    [ANN] gmailer 0.0.3

    Park Heesob, Aug 25, 2005, in forum: Ruby
    Replies:
    3
    Views:
    95
    Shashank Date
    Aug 25, 2005
  3. Park Heesob

    [ANN] gmailer-0.0.5

    Park Heesob, Aug 28, 2005, in forum: Ruby
    Replies:
    0
    Views:
    87
    Park Heesob
    Aug 28, 2005
  4. Park Heesob

    [ANN] gmailer-0.0.7

    Park Heesob, Aug 30, 2005, in forum: Ruby
    Replies:
    2
    Views:
    99
    Daniel Schierbeck
    Aug 30, 2005
  5. Park Heesob

    [ANN] gmailer-0.0.8 released

    Park Heesob, Sep 3, 2005, in forum: Ruby
    Replies:
    8
    Views:
    109
    Park Heesob
    Sep 4, 2005
Loading...

Share This Page