Evening all!
I've hit a brick wall with this problem... can't understand why it's so hard either! I'm hoping that some of you guys will have some ideas...
I'm trying to write a script in either JavaScript or PHP (doesn't matter which) that will allow you to copy and paste a conversation either from an email or an instant messaging program such as msn or adium. The idea is the script would read the conversation and split it up into it's messages, as well as extract the sender name and the time...
So for example if I had this conversation:
It would be interpreted by the script to this..
Now obviously emails and IM conversations aren't in the same format, so it'd have to be able to cope with a variable input.. so you could specify that the start of each message is in the following format:
or
or
If anyone has any ideas about how to go about this or has seen this done before I'd really appreciate the input.
Thanks in advance!
I've hit a brick wall with this problem... can't understand why it's so hard either! I'm hoping that some of you guys will have some ideas...
I'm trying to write a script in either JavaScript or PHP (doesn't matter which) that will allow you to copy and paste a conversation either from an email or an instant messaging program such as msn or adium. The idea is the script would read the conversation and split it up into it's messages, as well as extract the sender name and the time...
So for example if I had this conversation:
gavin holt
20:50
this is gavin's 1st message
rich
20:50
this is rich's 1st message
gavin holt
20:54
this is gavin's 2nd message
54:44
this is gavin's 3rd message
54:47
this is gavin's 4th message
rich
20:55
this is rich's 2nd message
56:46
this is rich's 3rd message
gavin holt
20:57
this is gavin's 5th message
It would be interpreted by the script to this..
Gavin - 20:50 - this is gavin's 1st message
Rich - 20:50 - this is rich's 1st message
Gavin - 20:54 - this is gavin's 2nd message
Gavin - 20:54 - this is gavin's 3rd message
Gavin - 20:54 - this is gavin's 4th message
Rich - 20:55 - this is rich's 2nd message
Rich - 20:56 - this is rich's 3rd message
Gavin - 20:57 - this is gavin's 5th message
Now obviously emails and IM conversations aren't in the same format, so it'd have to be able to cope with a variable input.. so you could specify that the start of each message is in the following format:
rich
%TIME%
...
or
Richard @ %DATETIME%
...
or
On %DATETIME% Richard wrote:
...
If anyone has any ideas about how to go about this or has seen this done before I'd really appreciate the input.
Thanks in advance!