[ANN] gmailer-0.0.2

P

Park Heesob

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 => "(e-mail address removed)",
: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
 
K

Konstantin Levinski

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 : )
 
J

James Britt

Park said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top