drupalr.postComment: Post a comment to a Drupal site.

Description Usage Arguments Author(s) Examples

Description

This function allows a comment to be posted to a Drupal node.

Usage

1
drupalr.postComment(d_url, d_path, body, params, c)

Arguments

d_url

The base URL of teh Drupal site.

d_path

The path to the node you are commenting on.

body

The comment body.

params

Additional CURL parameter for optional fields.

c

A CURL handler for the authenticated user.

Author(s)

Ed Baker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(d_url, d_path, body, params, curl) {
  comment_params = list(
    op="Save",
    'comment_body[und][0][value]' = body,
    'comment_body[und][0][format]' = 'comment_filtered_html'
  );
  params <- c(params, comment_params);
  drupalr.postForm(d_url, d_path, "comment_form", params, curl);
}

edwbaker/DrupalR documentation built on May 15, 2019, 11:04 p.m.