Learn R Programming

discgolf (version 0.2.0)

posts: Work with posts

Description

Work with posts

Usage

post_get(post_id, url = NULL, key = NULL, user = NULL, ...)

post_create(topic_id, text, url = NULL, key = NULL, user = NULL, ...)

post_wikify(post_id, url = NULL, key = NULL, user = NULL, ...)

Arguments

post_id

A post id

url

Base url for a Discourse installation. See disc_setup

key

Your api key on the Discourse installation. See disc_setup

user

Your user name on the Discourse installation. See disc_setup

...

Named parameters passed on to HttpClient

topic_id

A topic id

text

Text to put in post

Examples

Run this code
# NOT RUN {
# get a post
post_get(90)
post_get(120)
post_get(130)
post_get(155)
cat(post_get(155)$raw)

# create post, create topic first
z <- topic_create("The problems with blue skies",
  text = "just saying these things cause I like the sky very much")
zz <- post_create(topic_id = z$topic_id,
  text = "There isn't a problem is there?")
topic(z$topic_id)
post_get(zz$id)

# Wikify a post
post_wikify(zz$id)

# cleanup - delete the topic
topic_delete(z$topic_id)
# }

Run the code above in your browser using DataLab