Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] gmailer-0.0.2

Reply
Thread Tools

[ANN] gmailer-0.0.2

 
 
Park Heesob
Guest
Posts: n/a
 
      08-20-2005
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 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








 
Reply With Quote
 
 
 
 
Konstantin Levinski
Guest
Posts: n/a
 
      08-20-2005
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 : )

 
Reply With Quote
 
 
 
 
James Britt
Guest
Posts: n/a
 
      08-24-2005
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments