15 Mar 2010
This is an R package that allows us to interact with a blog. We can
The package is a nice example of the ease with which one can use XML-RPC within R to invoke remote methods with data from within R.
The following is a table of the R functions and the corresponding XML-RPC method along with a link to its reference documentation.
| R function | XML-RPC API method and link |
|---|---|
| categories | mt.getCategoryList |
| deleteCategory | wp.deleteCategory |
| deletePage | wp.deletePage |
| deletePost | metaWeblog.deletePost |
| getCategories | mt.getCategoryList |
| getCategoryList | mt.getCategoryList |
| getOptions | wp.getOptions |
| getPage | wp.getPage |
| getPageList | wp.getPageList |
| getPageStatusList | wp.getPageStatusList |
| getPages | wp.getPages |
| getPost | metaWeblog.getPost |
| getPostCategories | mt.getPostCategories |
| getPostStatusList | wp.getPageStatusList |
| getRecentPostTitles | mt.getRecentPostTitles |
| getTags | wp.getTags |
| getUsersBlogs | wp.getUsersBlogs |
| newCategory | wp.newCategory |
| newPage | wp.newPage |
| newPost | metaWeblog.newPost |
| publishPost | mt.publishPost |
| supportedMethods | mt.supportedMethods |
| supportedTextFilters | mt.supportedTextFilters |
| uploadFile | wp.uploadFile |
I will write some documentation that illustrates how to use this to post an entry to your blog.
The best thing to do is set the R option WordpressLogin to a vector giving the login and password for your blog.
options(WordpressLogin = c("duncan" = "mypassword"))
The functions will use that and you won't have to worry about
specifying it.