Best way to extract data from emails?


#1

Hi,

I’ve been working on something that would look at a form mail, and then
extract information out of that mail into ruby usable form.

For instance, let’s say someone sends you an email through eBay’s form
mail facility, but her message body is encapsulated in all that nice and
fancy HTML, so what I’d like to do is to hack up something that can read
in this email, and just get at the message body less the extra
formatting.

What’d be the best way to go about doing it?

I know it can be done with regular expressions, but ideally I want to
make this a solution that can be easily updated as the format of the
emails change, so regular expressions might not be able to give that
flexibility.

Any tips welcome! :slight_smile:

Thanks.


#2

You might get more response to this on the rails list itself, since
it’s not engine-specific…

  • james

On 2/6/06, Woei S. removed_email_address@domain.invalid wrote:


Posted via http://www.ruby-forum.com/.


engine-users mailing list
removed_email_address@domain.invalid
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

#3

in this email, and just get at the message body less the extra
formatting.

I once did this by piping the message-body through a console-based
browser such as w3m… Seems pretty fail-safe and easy…

Wybo