Skip to content

XML-PRC package for Go programming language.

Notifications You must be signed in to change notification settings

ibmcb/go-xmlrpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

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

  • Go 100.0%