[wp-trac] [WordPress Trac] #23625: Add function to extract or parse chat as structured data

WordPress Trac noreply at wordpress.org
Thu Mar 7 16:29:43 UTC 2013


#23625: Add function to extract or parse chat as structured data
----------------------------------------+------------------
 Reporter:  wonderboymusic              |       Owner:
     Type:  feature request             |      Status:  new
 Priority:  normal                      |   Milestone:  3.6
Component:  Post Formats                |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
----------------------------------------+------------------
Changes (by nacin):

 * keywords:  has-patch => has-patch needs-unit-tests


Comment:

 I would use a simple check for names:

 `^(.*?): `

 Putting it another way, `explode( ':', $line, 2 )`.

 That's it. If it has a timestamp, then let it be part of the meta info for
 that line.

 This would break in one situation: Gmail's chat output does not repeat the
 person's name in subsequent lines. If they use a colon, then the first
 phrase will be caught as the "name". I don't mind that. Note, this is
 exactly how Tumblr also happens to parse it.

 I like the idea of make_clickable() being inside the core function. Let's
 consider running that once over the entire chat content, rather than on
 each line, if we can get away with it.

 Really needs unit tests!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23625#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list