discgolf
is an R client for the Discourse API, based off the Ruby gem discourse_api
Discourse API docs: http://docs.discourse.org
CRAN version
install.packages("discgolf")
Development version
install.packages("devtools")
devtools::install_github("sckott/discgolf")
library("discgolf")
The Discourse API is based on using a specific installation of Discourse, which requires your username and an API key for that installation. Get those, and you can pass them in to each function call, or set as option variables in .Rprofile
(use discourse_api_key
and discourse_username
) or environment variables in .Renviron
(use DISCOURSE_API_KEY
and DISCOURSE_USERNAME
).
topics_latest()
topics_latest()$topic_list$topics[,c(1:5)]
topics_new()
topics_by("cboettig")
topic(8)
topic(8)$post_stream$posts[,c(1:5)]
post_get(90)
topic_create("The problem with blue skies", text = "just saying and all that")
post_create(topic_id = 13, text = "There isn't a problem!")
post_wikify(x$post_stream$posts$id[4])
dg_search(query = "poo")
dg_search(posts_count = 1)
dg_search(in_ = "posted")
dg_search(status = "open")
user('sckott')
user('cboettig')
users_list('staff')
users_list('new')
(x <- user_create("jane doe", "jane@doe.com", "jane_doe", "afafasfdasdf"))
user_activate(x$user_id)
user_update_email('jane_doe', 'jane2@doe.com')
user_update_username('jane_doe', 'jane_doe2')
user_delete(x$user_id)