[wp-trac] Re: [WordPress Trac] #7612: Tumblr importer

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 27 16:11:18 GMT 2008


#7612: Tumblr importer
-------------------------+--------------------------------------------------
 Reporter:  hailin       |        Owner:  anonymous
     Type:  enhancement  |       Status:  new      
 Priority:  normal       |    Milestone:  2.7      
Component:  General      |      Version:           
 Severity:  normal       |   Resolution:           
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by hailin):

  * type:  defect => enhancement

Comment:

 I've reviewed and experimented the Tumblr export code from Hao.

  The current wordpress.org and wordpress.com import code replies on
 preg_match to extract tags, largely because of legacy reasons -
 powerful XML parsing modules such as SimpleXMLElement are not
 available in PHP 4.x.  Using PHP 5.x built-in XML  parsers can produce
 much cleaner and faster code.  I can envision that we significantly
 improve our import code, by rewriting the XML parsing logic, once we
 switch to PHP 5.x.

 Hao's current Tumblr export code replies on SimpleXMLElement, which is
 the preferred approach.  I don't think it's worthwhile to rewrite it
 using our existing, old preg_match approach.

 I've suggested taking a better alternative approach:

 Since Tumblr has simple formats, we can directly parse it's xml and
 create WordPress posts and categories, thus eliminating the intermediary
 step of exporting it to a WordPress XML file.

 The approach would be similar to
 wp-admin/import/rss.php

 where the following functions are used to create post/category:

 wp_insert_post($post);
 wp_create_categories($categories, $post_id);

 I would suggest that we wait till we migrate to PHP 5.x to incorporate the
 Tumblr export code into wp core.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7612#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list