Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7899043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:35:55+00:00 2026-06-03T08:35:55+00:00

Is there any PHP class or resource for using Metaweblog api ? I want

  • 0

Is there any PHP class or resource for using Metaweblog api ?
I want to add this api to my own cms (like wp) so that other application could easily post (or …) throw it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:35:56+00:00Added an answer on June 3, 2026 at 8:35 am

    Implementation of the MetaWeblog API http://www.xmlrpc.com/metaWeblogApi in PHP.

    I looked to this script I linked for inspiration to develop the implementation I’m currently using. Feel free to use the example code below as an example of implementing the metaweblog API – but please consider using a modern XMLRPC library. I’ve included a link to a modified version of the original “xmlrpc.php” file that the example code requires.

    Here’s the xmlrpc library the example code utilizes: XMLRPC library modified to work with PHP 5.4 – originally written by Keith Devens.

    Doing a quick package search on packagist also provides many great options that are much more forward thinking in terms of PHP standards. ZendFramework2 even includes a component you can use in your project with minimal dependencies (10 packages – not the entire framework). I would strongly recommend that this example code, be used as such, and any new development be done with a modern XMLRPC library.

    Adding the example code here in case the first link dies:

    <?php
    /**
     * Skeleton file for MetaWeblog API http://www.xmlrpc.com/metaWeblogApi in PHP
     * Requires Keith Devens' XML-RPC Library http://keithdevens.com/software/xmlrpc and store it as xmlrpc.php in the same folder
     * Written by Daniel Lorch, based heavily on Keith Deven's examples on the Blogger API.
     */
    
    require_once dirname(__FILE__) . '/xmlrpc.php';
    
    function metaWeblog_newPost($params) {
      list($blogid, $username, $password, $struct, $publish) = $params;
      $title = $struct['title'];
      $description = $struct['description'];
    
    
      // YOUR CODE:
      $post_id = 0; // id of the post you just created
    
    
      XMLRPC_response(XMLRPC_prepare((string)$post_id), WEBLOG_XMLRPC_USERAGENT);
    }
    
    function metaWeblog_editPost($params) {
      list($postid, $username, $password, $struct, $publish) = $params;
    
    
      // YOUR CODE:
      $result = false; // whether or not the action succeeded
    
    
      XMLRPC_response(XMLRPC_prepare((boolean)$result), WEBLOG_XMLRPC_USERAGENT);
    }
    
    function metaWeblog_getPost($params) {
      list($postid, $username, $password) = $params;
      $post = array();
    
    
      // YOUR CODE:
      $post['userId'] = '1';
      $post['dateCreated'] = XMLRPC_convert_timestamp_to_iso8601(time());
      $post['title'] = 'Replace me';
      $post['content'] = 'Replace me, too';
      $post['postid'] = '1';
    
    
      XMLRPC_response(XMLRPC_prepare($post), WEBLOG_XMLRPC_USERAGENT);
    }
    
    function XMLRPC_method_not_found($methodName) {
      XMLRPC_error("2", "The method you requested, '$methodName', was not found.", WEBLOG_XMLRPC_USERAGENT);
    }
    
    $xmlrpc_methods = array(
        'metaWeblog.newPost'  => 'metaWeblog_newPost',
        'metaWeblog.editPost' => 'metaWeblog_editPost',
        'metaWeblog.getPost'  => 'metaWeblog_getPost'
        );
    
    $xmlrpc_request = XMLRPC_parse($HTTP_RAW_POST_DATA);
    $methodName = XMLRPC_getMethodName($xmlrpc_request);
    $params = XMLRPC_getParams($xmlrpc_request);
    
    if(!isset($xmlrpc_methods[$methodName])) {
      XMLRPC_method_not_found($methodName);
    } else {
      $xmlrpc_methods[$methodName]($params);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

like DOMDocument class in PHP, is there any class in RUBY (i.e the core
Is there any php libraries or API's that help when dealing with X12 documents
I just want to ask if there is any PHP/MySQL datatype that can store
Possible Duplicate: PHP pagination class are there any PHP/Class libraries that i can utilize
Is there any PHP framework/library that allows me to do something like: $element =
Is there any way to call a php class (eg. $var = new className)
Is there any thing in PHP to create basic scaffold, like in Rails? EDIT:
Is there any function like php's mb_convert_encoding which can convert an encoding to another?
When defining a PHP class, which is preferred/best practice? Are there any key differences
Is there any class or library that I can use for profiling, finding bottlenecks,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.