Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: services/blog.php

ContentClick to slide

services/blog.php - Process remote blog calls

This script interfaces YACS with popular weblog client software.

The support of the XML-RPC API in YACS is really straightforward. The main complexity is that different words are used for same things. Therefore, please keep in mind that metaWeblog' blogs are YACS sections.

At the moment YACS supports following specifications:

Error codes

YACS uses standard error codes, as specified in Specification for Fault Code Interoperability: "As the number of xml-rpc server implementations has proliferated, so has the number of error codes and descriptions. The charter of this specification is to define a small set of error codes that are common across most server implementations so that clients can programmatically handle common errors such as "method not found" or "parse error"."

Here are the error codes and their meaning:

blogger.deletePost

Definitely suppress an existing post.

Syntax: blogger.deletePost(ignored_appkey, postid, username, password) returns boolean

blogger.editPost

Modify or publish an existing post.

Syntax: blogger.editPost(ignored_appkey, postid, username, password, content, publish) returns boolean

The content field can include following HTML tags:

If the publish field is set to TRUE, the publication mechanism YACS is correctly used

blogger.getPost

Read one post.

Syntax: blogger.getPost(ignored_appkey, postid, username, password) returns struct

Returns following components:

blogger.getRecentPosts[/subtitle]

List most recent posts at a given blog.

Syntax: blogger.getRecentPosts(ignored_appkey, blogid, username, password, numberOfPosts) returns array of structs

Returns up to 30 posts of the mentioned section. Each post has following components: Returns following components: dateCreated - date of last editionuserid - id of last editorpostid - page idcontent - the actual page content - with 'introduction' and 'source' sub components

[title]blogger.getTemplate

Read one template.

Syntax: blogger.getTemplate(ignored_appkey, blogid, username, password, template_type) returns string

Template type can be either 'main' or 'archiveIndex'.

If the target section does have a template attribute, it is returned to caller. Else a bare and simple template is returned instead.

blogger.getUserInfo[/subtitle]

Get attributes for one user profile

Syntax: blogger.getUserInfo(ignored_appkey, username, password) returns an array

Returns following attributes: useridfirst name (actually, the nick name)lastname (actually, the full name)email addressweb address

[title]blogger.getUsersBlogs[/subtitle]

List blogs allowed for one user profile. Assigned sections are listed first, as a convenient mean to access areas with explicit editorial responsibilities. Then up to 9 top-level sections are listed, with up to 9 sub-sections for each of them. This provide a hierarchical view of the site map through XML-RPC. Also, items are numbered to ensure proper sorting of items in w.bloggar.

Syntax: blogger.getUsersBlogs(ignored_appkey, username, password) returns an array

Returns following attributes: url (of the blog/section)blogidblogname (actually, the section title)

[title]blogger.newPost[/subtitle]

Submit a new post.

Syntax: blogger.newPost(ignored_appkey, blogid, username, password, content, publish) returns string

The content field can include following HTML tags: source - set the page source, usually, an originating URLintroduction - set the page introduction

If the publish field is set to TRUE, the publication mechanism of YACS is correctly used

[title]blogger.setTemplate

Change one template.

Syntax: blogger.setTemplate(ignored_appkey, blogid, username, password, template_content, template_type) returns true or false

Template type can be either 'main' or 'archiveIndex'.

YACS only supports the type 'index'. Other types are silently ignored.

The template is translated as a PHP YACS skin (i.e., template.php and skin.php) and the skin name is section_<blogid>.

The provided template text is saved as a section attribute, for later retrieval through calls to blogger.getTemplate.

metaWeblog.editPost

Modify or publish an existing post.

Syntax: metaWeblog.editPost(postid, username, password, struct, publish) returns true

Following components of the struct are correctly processed:

If the publish field is set to TRUE, the publication mechanism YACS is correctly used

metaWeblog.getCategories

List categories for a given blog.

Syntax: metaWeblog.getCategories(blogid, username, password) returns struct

In YACS categories are shared at the system level, therefore the blogid parameter is not used. Returns up to 50 YACS categories.

metaWeblog.getPost

Read one post.

Syntax: metaWeblog.getPost(postid, username, password) returns struct

Returns following components:

metaWeblog.getRecentPosts[/subtitle]

List most recent posts at a given blog.

Syntax: metaWeblog.getRecentPosts(blogid, username, password, numberOfPosts) returns array of structs

Returns up to 30 posts of the mentioned section. Each post has following components: dateCreated - date of last editionuserid - id of last editorpostid - page idtitle - page titleurl - the web address to get the original pagedescription - the actual page content - with 'introduction' and 'source' sub componentsauthor - mail address of the page creatorcomments - the web address to comment the page

[title]metaWeblog.newMediaObject

This function is not supported.

Upload some file

Syntax: metaWeblog.newMediaObject(blogid, username, password, struct) returns struct

The submitted struct has following attributes:

The returned structure has only one attribute:

metaWeblog.newPost

Submit a new post.

Syntax: metaWeblog.newPost(blogid, username, password, struct, publish) returns string

Following components of the struct are processed:

If the publish field is set to TRUE, the publication mechanism of YACS is correctly used

This script is a reference file of this system.



Voir aussi:

Licence: GNU Lesser General Public License

Auteurs:

Testeurs:

Reste à faire:

Tools
Browse the source of this script
Server software