Buying XML RPC Wordpress $50

Discussion in 'Programming' started by bunbunx2, Jun 27, 2011.

  1. #1
    Wordpress XML RPC need help

    Hi there, i am currently using wordpress XML RPC, got some issue over here.

    Basically i wanna use the xml rpc code which i have below to do the following

    
    <?php 
    require_once("IXR_Library.php.inc");
     
    $client->debug = true; //Set it to false in Production Environment
     
    $value = "204541752925026 204542356258299 ";
    $output = explode(" ",$value);
    $thumbnail = file_get_contents("http://www.somedomain.com/thumb.php?id=".$output[0]);
    
    $time = new DateTime('now', new DateTimeZone('UTC'));
    $time = strtotime("+30 minutes");
    $thedate = date('Y-m-d H:i:s', $time);
    echo $thedate;
    
    $content = 'Hello world';
    
    $title="Blog Title"; // $title variable will insert your blog title 
    $body=$content; // $body will insert your blog content (article content)
     
    $category="unknown"; // Comma seperated pre existing categories. Ensure that these categories exists in your blog.
    $keywords="keyword1";
     
    $customfield = array(
      array( 'key' => 'key', 'value' => 'value' ),
    );
    
        $title = htmlentities($title,ENT_NOQUOTES,$encoding);
        $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);
        $content = array(
            'title'=>$title,
            'description'=>$body,
            'mt_allow_comments'=>1,  // 1 to allow comments
            'mt_allow_pings'=>0,  // 1 to allow trackbacks
            'post_type'=>'post',
            'mt_keywords'=>$keywords,
            'categories'=>array($category),
    		'custom_fields' =>  $customfield
     
     
        );
     
    print_r($content);
    // Create the client object
    $client = new IXR_Client('http://www.somedomain.com/xmlrpc.php');
     
     $username = "user"; 
     $password = "pass"; 
     $params = array(0,$username,$password,$content,true); // Last parameter is 'true' which means post immideately, to save as draft set it as 'false'
     
    // Run a query for PHP
    if (!$client->query('metaWeblog.newPost', $params)) {
        die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
    }
    else
        echo "Article Posted Successfully";
     
    ?>
    
    Code (markup):
    With this, i can create a post on my wordpress blog using XML Rpc, but i need to create new post which is on Schedule and will be "Published" in like 30 minutes, means post need to be schedule to be publish in 30 minutes, time have to add 30 minutes, can anyone modify the code so when i use this php code, all post will only appear at my homepage after 30 minutes of creation.

    AT current , when i use the code, the post will be publish right away. I want it to be schedule and when times up, it will auto be publish..

    My wordpress timezone is UTC + 0

    CMS: Wordpress
    Payment: $50 usd
    Mode: Paypal
     
    bunbunx2, Jun 27, 2011 IP
  2. militarysmurf

    militarysmurf Member

    Messages:
    93
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    40
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Solution is fairly simple, can be done in ~1 hr
     
    militarysmurf, Jun 27, 2011 IP
  3. bunbunx2

    bunbunx2 Peon

    Messages:
    613
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    ok looking forwards for your code. i will pay more if u can finish within the time
     
    bunbunx2, Jun 27, 2011 IP
  4. codebreaker

    codebreaker Well-Known Member

    Messages:
    281
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    here's the code..I hope I got here first .
    
    <?php 
    require_once("IXR_Library.php.inc");
     
    $client->debug = true; //Set it to false in Production Environment
     
    $value = "204541752925026 204542356258299 ";
    $output = explode(" ",$value);
    $thumbnail = file_get_contents("http://www.somedomain.com/thumb.php?id=".$output[0]);
    
    $content = 'Hello world';
    
    $title="Blog Title"; // $title variable will insert your blog title 
    $body=$content; // $body will insert your blog content (article content)
     
    $category="unknown"; // Comma seperated pre existing categories. Ensure that these categories exists in your blog.
    $keywords="keyword1";
     
    $customfield = array(
      array( 'key' => 'key', 'value' => 'value' ),
    );
    	$time=time()+1800; //30 mins in the future , 1800 seconds
    	$post_date=date("Ymd\TH:i:s",$time);
    	$date=new IXR_Date($post_date);
    	
        $title = htmlentities($title,ENT_NOQUOTES,$encoding);
        $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);
        $content = array(
            'title'=>$title,
            'description'=>$body,
            'mt_allow_comments'=>1,  // 1 to allow comments
            'mt_allow_pings'=>0,  // 1 to allow trackbacks
            'post_type'=>'post',
            'mt_keywords'=>$keywords,
            'categories'=>array($category),
    		'custom_fields' =>  $customfield,
    		'date_created_gmt' =>$date
     
     
        );
     
    print_r($content);
    // Create the client object
    $client = new IXR_Client('http://www.somedomain.com/xmlrpc.php');
     
     $username = "user"; 
     $password = "pass"; 
     $params = array(0,$username,$password,$content,true); // Last parameter is 'true' which means post immideately, to save as draft set it as 'false'
     
    // Run a query for PHP
    if (!$client->query('metaWeblog.newPost', $params)) {
        die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
    }
    else
        echo "Article Posted Successfully";
     
    ?>
    
    Code (markup):
    the 1800 thing is 30 mins in the future..If you want 1 hour you replace it with 3600 and so
     
    codebreaker, Jun 27, 2011 IP