Discourse API Client

Client for the Discourse API. Discourse is a open source discussion forum platform (< https://www.discourse.org/>). It comes with 'RESTful' API access to an installation. This client requires that you are authorized to access a Discourse installation, either yours or another.


Build Status codecov.io rstudio mirror downloads cran version

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")

Authentication

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).

Get latest topics

topics_latest()
topics_latest()$topic_list$topics[,c(1:5)]

Get new topics

topics_new()

Get topics by a specific user

topics_by("cboettig")

Get a single topic by id number

topic(8)
topic(8)$post_stream$posts[,c(1:5)]

Get a post

post_get(90)

create post, create topic first

topic_create("The problem with blue skies", text = "just saying and all that")
post_create(topic_id = 13, text = "There isn't a problem!")

Wikify a post

post_wikify(x$post_stream$posts$id[4])

Search

dg_search(query = "poo")
dg_search(posts_count = 1)
dg_search(in_ = "posted")
dg_search(status = "open")

list a user

user('sckott')
user('cboettig')

list users

users_list('staff')
users_list('new')

create a user

(x <- user_create("jane doe", "[email protected]", "jane_doe", "afafasfdasdf"))

activate a user

user_activate(x$user_id)

upate email address

user_update_email('jane_doe', '[email protected]')

upate user name

user_update_username('jane_doe', 'jane_doe2')

delete a user

user_delete(x$user_id)

Meta

  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

News

discgolf 0.2.0

NEW FEATURES

  • swap httr for crul for HTTP requests (#8)

discgolf 0.1.0

NEW FEATURES

  • Released to CRAN.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("discgolf")

0.2.0 by Scott Chamberlain, a year ago


https://github.com/sckott/discgolf


Report a bug at https://github.com/sckott/discgolf/issues


Browse source code at https://github.com/cran/discgolf


Authors: Scott Chamberlain [aut, cre]


Documentation:   PDF Manual  


Task views: Web Technologies and Services


MIT + file LICENSE license


Imports crul, jsonlite, xml2

Suggests testthat


See at CRAN