Index: livejournal-importer.php
===================================================================
--- livejournal-importer.php	(revision 305916)
+++ livejournal-importer.php	(working copy)
@@ -10,6 +10,22 @@
 License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */
 
+add_action( 'wp_ajax_lj-importer', 'livejournal_import_ajax_handler' );
+
+function livejournal_import_ajax_handler() {
+	check_ajax_referer( 'lj-api-import' );
+	if ( !current_user_can( 'publish_posts' ) )
+		die('-1');
+	if ( empty( $_POST['step'] ) )
+		die( '-1' );
+	define('WP_IMPORTING', true);
+	include( ABSPATH . 'wp-admin/import/livejournal.php' );
+	$result = $lj_api_import->{ 'step' . ( (int) $_POST['step'] ) }();
+	if ( is_wp_error( $result ) )
+		echo $result->get_error_message();
+	die;
+}
+
 if ( !defined('WP_LOAD_IMPORTERS') )
 	return;
 
@@ -1070,13 +1086,6 @@
 		do_action( 'import_end' );
 	}
 
-	function LJ_API_Import() {
-		$this->__construct();
-	}
-
-	function __construct() {
-		// Nothing
-	}
 }
 
 $lj_api_import = new LJ_API_Import();
