<?php

// Set the following parameters
$tumblrEmail = '';
$tumblrPassword = '';
$file = '';
// location of exported wordpress xml
$categories = array();
// ex blog, news, videos
$oldDomain = '';
// ex mywordpress.com (set this if you want relative links in posts converted to absolute before importing… note this should only be done if your old site will be set up to forward links to your new one.)
$resolver = array();
$tumblr = new Tumblr();
$tumblr->setCredentials($tumblrEmail, $tumblrPassword);
$wpt = new WordpressToTumblr();
$wpt->setWordpressXmlFile($file);
$wpt->loadXML();
$wpt->setTumblrObject($tumblr);
$wpt->postToTumblr();
class WordpressToTumblr
{
    private $wpExportFile;
    private $xml;
    private $tumblr;
    public function setWordpressXmlFile($file)
    {
        $this->wpExportFile = $file;
    }
    public function loadXML()
    {
        $this->xml = simplexml_load_file($this->wpExportFile);