2017 © Pedro Peláez
 

library metaweblog

A legacy metaweblog-compliant rpc interface

image

comodojo/metaweblog

A legacy metaweblog-compliant rpc interface

  • Saturday, October 17, 2015
  • by comodojo
  • Repository
  • 3 Watchers
  • 1 Stars
  • 53 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

comodojo/metaweblog

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality Code Coverage, (*1)

A metaweblog rpc client., (*2)

This is the development branch, please do not use it in production, (*3)

This lib is intended to be used as basic client for many blog platforms (such as wordpress) or to generate testing cases for rpc server., (*4)

Installation

Install composer, then:, (*5)

composer require comodojo/metaweblog, (*6)

Usage example

Getting recent posts from a blog:, (*7)

try {

    // Create a new metaweblog instance providing address, username and password
    $mwlog = new \Comodojo\MetaWeblog\MetaWeblog( "www.example.org", "john", "doe" );

    // Get last 10 posts
    $posts = $mwlog->getRecentPosts(10);

} catch (\Exception $e) {

    /* something did not work :( */

}

Supported methods

This library supports the whole metaweblog API:, (*8)

  • getPost($id): retrieve a post from weblog, (*9)

  • getRecentPosts(/*optional, default 10*/ $howmany): get $howmany posts from blog, (*10)

  • newPost($struct, /*optional, default true*/ $publish): create new post, (*11)

  • editPost($postId, $struct, /*optional, default true*/ $publish): edit post referenced by postId, (*12)

  • deletePost($postId, /*optional, default false*/ $appkey, /*optional, default false*/ $publish): delete a post referenced by postId, (*13)

  • getCategories(): retrieve a list of categories from weblog, (*14)

  • newMediaObject($name, $mimetype, $content, /*optional, default false*/ $overwrite): upload a new media to weblog using metaWeblog.newMediaObject call, (*15)

  • getTemplate($template_type, /*optional, default false*/ $appkey): get template, (*16)

  • setTemplate($template, $template_type, /*optional, default false*/ $appkey): set template, (*17)

  • getUsersBlogs(/*optional, default false*/ $appkey): returns information about all the blogs a given user is a member of, (*18)

Refer to comodojo/metaweblog API for more detailed informations about methods., (*19)

RPC client and transport options

The getRpcClient() method allows access to rpc client options (and also transport options)., (*20)

For example, to get recent post from a blog listening on port 8080:, (*21)

try {

    // Create a new metaweblog instance providing address, username and password
    $mwlog = new \Comodojo\MetaWeblog\MetaWeblog( "www.example.org", "john", "doe" );

    $mwlog->getRpcClient()->getTransport()->setPort(8080);

    // Get last 10 posts
    $posts = $mwlog->getRecentPosts(10);

} catch (\Exception $e) {

    /* something did not work :( */

}

Other setters/getters

  • Get/set blog ID, (*22)

        // Get current blog ID
        $id = $mwlog->getId()
    
        // Set current blog ID
        $mwlog->setId(2);
    
    
  • Get/set encoding, (*23)

        // Get current encoding
        $enc = $mwlog->getEncoding()
    
        // Set current encoding
        $mwlog->setEncoding('utf-8');
    
    

Documentation

Contributing

Contributions are welcome and will be fully credited. Please see CONTRIBUTING for details., (*24)

License

comodojo/metaweblog is released under the MIT License (MIT). Please see License File for more information., (*25)

The Versions

17/10 2015

dev-master

9999999-dev https://comodojo.org

A legacy metaweblog-compliant rpc interface

  Sources   Download

MIT

The Requires

 

The Development Requires

blog metaweblog xmlrpc comodojo

17/10 2015

1.0.4

1.0.4.0 https://comodojo.org

A legacy metaweblog-compliant rpc interface

  Sources   Download

MIT

The Requires

 

The Development Requires

blog metaweblog xmlrpc comodojo

13/05 2015

1.0.3

1.0.3.0 http://comodojo.org

A legacy metaweblog-compliant rpc interface

  Sources   Download

MIT

The Requires

 

The Development Requires

blog metaweblog xmlrpc comodojo

20/01 2015

1.0.2

1.0.2.0 http://comodojo.org

A legacy metaweblog-compliant rpc interface

  Sources   Download

GPL-3.0+

The Requires

 

blog metaweblog xmlrpc comodojo

19/01 2015

1.0.1

1.0.1.0 http://comodojo.org

A legacy metaweblog-compliant rpc interface

  Sources   Download

GPL-3.0+

The Requires

 

blog metaweblog xmlrpc comodojo

13/01 2015

1.0.0

1.0.0.0 http://comodojo.org

A legacy metaweblog-compliant rpc interface

  Sources   Download

GPL-3.0+

The Requires

 

blog metaweblog xmlrpc comodojo