modifyBlog | R Documentation |
These functions are for changing the content of a blog. We can create a new page, a new post on a page, add a new category, delete a category.
newCategory(category, description = "???", slug = category, parent = 0L,
blogid = 0, login = getOption("WordpressLogin", stop("need a login and password")),
.server = getServerURL())
publishPost(postid, login = getOption("WordpressLogin", stop("need a login and password")),
..., .server = getServerURL())
uploadFile(what, type = guessMIMEType(what), blogid = 0L,
login = getOption("WordpressLogin", stop("need a login and password")),
remoteName = basename(what), overwrite = TRUE, ..., .server = getServerURL() )
newPage(content, publish = TRUE, blogid = 0,
login = getOption("WordpressLogin", stop("need a login and password")), method = "wp.newPage", .server = getServerURL())
newPost(content, publish = TRUE, blogid = 0,
login = getOption("WordpressLogin", stop("need a login and password")), .server = getServerURL())
deleteCategory(categoryid, blogid = 0L, login = getOption("WordpressLogin", stop("need a login and password")), ..., .server = getServerURL() )
deletePage(pageid, blogid = 0L, login = getOption("WordpressLogin", stop("need a login and password")), ..., .server = getServerURL() )
deletePost(postid, login = getOption("WordpressLogin", stop("need a login and password")),
publish = TRUE, appId = "RWordPress", ..., .server = getServerURL() )
category |
the name of the new category to create |
categoryid |
the identifier for the category of interest. |
description |
the content of the blog post |
slug |
the desired name (i.e. URL) of the resource on the server when we create it. This can be omitted and the default is typically fine. |
parent |
the parent of the |
login |
the login and password given as
|
postid |
the identifier for the post. See
|
... |
additional arguments passed on to |
what |
the file to upload. This is typically a file name, but can
also be an R object given as an object of class |
type |
the MIME type of the file being uploaded. |
blogid |
the identifier for the blog. Often this can be left as 0 to identify the default blog identified by the specified login and password. |
remoteName |
the name to use for the file on the blog server. This allows us to use a different name than the one on the local system and to specify a name for anonymous object. |
overwrite |
whether to |
content |
the |
publish |
a logical value that controls whether the changes are immediately published. |
pageid |
the identifier for the page on the blog |
appId |
the name of our program making the request |
method |
the name of the actual XMLRPC method to invoke. This allows one function to be parameterized to implement multiple methods that are very similar. |
.server |
a string giving the URL of the Wordpress server. This
can be specified by the caller directly or can be set as a global
option in R named |
## Not run:
uploadFile("~/bob.png", "image/png")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.