Skip to content
This repository has been archived by the owner on Dec 10, 2017. It is now read-only.

blat/go-xmlrpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Go XML-RPC

XML-PRC package for Go programming language.

Usage

package main

import (
    "net/rpc/xmlrpc",
    "fmt",
    "log"
}

const (
    URL = "http://my.blog.com/wordpress/xmlrpc.php"
    USERNAME = "admin"
    PASSWORD = ""
    BLOG_ID = "0"
)

func main() {
    options := make(map[string]interface{})
    options["offset"] = 0
    options["number"] = 10
    response := xmlrpc.Request(URL, "getPosts", BLOG_ID, USERNAME, PASSWORD, options)

    for _, params := range response {
        for _, param := range params.([]interface{}) {
            log.Printf("%s", param.(map[string]interface{})["post_title"])
        }
    }
}

This example displays the title of the 10 last posts in a WordPress.

About

XML-PRC package for Go programming language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages