Scrapping email content

Scrapping email content

am 15.07.2009 06:25:16 von Areba Collins

Hello guys, i have a quick one:

Im working on an app that reads email and converts it into a post on a
forum, everything works fine except the threaded comments at the
bottom. I would like to delete everything that is from a previous
email (which usually begins with on this ate, so and so wrote : and
then comments preceeded by >>

Does anyone know a straightforward function to accomplish this?

Regards,
Collins -Nairobi KE.

--
If you have an apple and I have an apple and we exchange these apples
then you and I will still each have one apple. But if you have an idea
and I have an idea and we exchange these ideas, then each of us will
have two ideas.

George Bernard Shaw

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Scrapping email content

am 15.07.2009 09:38:28 von Tom Chubb

--001636b2ae6b28ea3b046eb9a432
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

2009/7/15 Areba Collins

> Hello guys, i have a quick one:
>
> Im working on an app that reads email and converts it into a post on a
> forum, everything works fine except the threaded comments at the
> bottom. I would like to delete everything that is from a previous
> email (which usually begins with on this ate, so and so wrote : and
> then comments preceeded by >>
>
> Does anyone know a straightforward function to accomplish this?
>
> Regards,
> Collins -Nairobi KE.
>
> --
> If you have an apple and I have an apple and we exchange these apples
> then you and I will still each have one apple. But if you have an idea
> and I have an idea and we exchange these ideas, then each of us will
> have two ideas.
>
> George Bernard Shaw
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
How about marking the email as read and not deleting it. Compare following
emails to previous read emails and strip out any common text and strip out
"> " and any other common indentation, etc.

--001636b2ae6b28ea3b046eb9a432--

Re: Scrapping email content

am 15.07.2009 09:51:24 von Ashley Sheridan

On Wednesday 15 July 2009 08:38:28 Tom Chubb wrote:
> 2009/7/15 Areba Collins
>
> > Hello guys, i have a quick one:
> >
> > Im working on an app that reads email and converts it into a post on a
> > forum, everything works fine except the threaded comments at the
> > bottom. I would like to delete everything that is from a previous
> > email (which usually begins with on this ate, so and so wrote : and
> > then comments preceeded by >>
> >
> > Does anyone know a straightforward function to accomplish this?
> >
> > Regards,
> > Collins -Nairobi KE.
> >
> > --
> > If you have an apple and I have an apple and we exchange these apples
> > then you and I will still each have one apple. But if you have an idea
> > and I have an idea and we exchange these ideas, then each of us will
> > have two ideas.
> >
> > George Bernard Shaw
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> How about marking the email as read and not deleting it. Compare following
> emails to previous read emails and strip out any common text and strip out
> "> " and any other common indentation, etc.

Or a regex a bit like this:

^>.+$

That should match any line beginning with a > character, so you can just
replace any such lines with nothing.

--
Thanks,
Ash
http://www.ashleysheridan.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php