Skip to content

ThiefMD/wordpress-vala

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

wordpress-vala

Unofficial WordPress API client library for Vala. Still a work in progress. It currently uses XML-RPC.

This is a simple API for publishing from ThiefMD, and will hopefully become fully compatible with time.

Compilation

I recommend including wordpress-vala as a git submodule and adding wordpress-vala/src/Wordpress.vala to your sources list. This will avoid packaging conflicts and remote build system issues until I learn a better way to suggest this.

For libsoup3, use wordpress-vala/src/Wordpress3.vala. Requires application level password.

Requirements

meson
ninja-build
valac
libgtk-3-dev

Building

meson build
cd build
meson configure -Denable_examples=true
ninja
./examples/hello-wordpress

Examples require update to username and password, don't check this in

string user = "username";
string password = "password";

ToDo:

Authentication with JWT extension.

Quick Start

Authentication

Wordpress.Client client = Client (url, username, password);
if (client.authenticate ()) {
    print ("You logged in!");
}

Simple Post

Wordpress.Client client = Client (url, username, password);

string id;
if (client.create_post_simple (out id,
    "Hello world",
    "<p>Hello wordpress</p>"))
{
    print ("New post at %s/?p=%s", url, slug);
}

Simple Image Upload

Wordpress.Client client = Client (url, username, password);

string id;
string slug;
if (client.upload_image_simple (
    out file_url,
    "/home/user/Pictures/photo.jpeg"))
{
    print ("New image at %s", file_url);
}

Releases

No releases published

Packages

No packages published