The Storyteller

WordPress Blogrolls Importer – Opensource

April 15, 2007 · 4 Comments

Today I developed this tool to import wordpress blog rolls as XML document. You know when you export data from wordpress.com that doesn’t include the blog rolls data. So if you want to keep a backup of your blog rolls, you can use this tool to import your blog rolls data.. This one is developed using PHP and Curl

importer.gif

You can doewnload it and see the code in action here

Opensource WordPress Blogrolls Importer

################

The trick is lying here –
;

    

    $ch curl_init();

    
curl_setopt($chCURLOPT_COOKIEJAR“./login.jar”);

    

    

    
curl_setopt($chCURLOPT_RETURNTRANSFER,1);

    //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  // this line makes it work under https

    
curl_setopt($chCURLOPT_URL,“{$url}/wp-login.php”);

    curl_setopt($chCURLOPT_POST1);

    
curl_setopt($chCURLOPT_FOLLOWLOCATION,1);

    
curl_setopt($chCURLOPT_POSTFIELDS“log={$username}&pwd={$password}&&redirect_to=wp-admin/link-manager.php&wp_submit=”);

    

    $buffercurl_exec ($ch); // execute the curl command

    

Categories: Cool Webapps · OpenSource · PHP · wordpress

4 responses so far ↓

  • omiazad // April 15, 2007 at 10:26 pm | Reply

    Why anyone wants to do that? I mean why this is useful? If I take my whole blog somewhere else, I’ll get this too. Isn’t it?

  • hasin // April 15, 2007 at 10:43 pm | Reply

    Nope

  • Rakibul Islam // April 18, 2007 at 11:35 am | Reply

    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.

    ——————————————————————————–

    XML document must have a top level element. Error processing resource ‘http://localhost/blogrollimporter/blogrollsimporter….

  • Rakibul Islam // April 18, 2007 at 11:50 am | Reply

    I found the solution. The Problem was in line 33
    if ($jobstart===false) break; //quit if there is no more blogrolls

    which should be :
    if ($jobstart==false) break; //quit if there is no more blogrolls

Leave a Comment