Learn R Programming

discgolf

discgolf is an R client for the Discourse API, based off the Ruby gem discourse_api

Discourse API docs: http://docs.discourse.org

Installation

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", "jane@doe.com", "jane_doe", "afafasfdasdf"))

activate a user

user_activate(x$user_id)

upate email address

user_update_email('jane_doe', 'jane2@doe.com')

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.

Copy Link

Version

Install

install.packages('discgolf')

Monthly Downloads

26

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

January 3rd, 2018

Functions in discgolf (0.2.0)

categories

Work with categories
dg_search

Search
notifications

Notifications data
disc_setup

Discgolf setup
tag

Tag data
users

Work with users
groups

Work with groups
discgolf-package

R Client for Discourse API
posts

Work with posts
email

Email
private_messages

Private messages
badges

Work with badges
topics

Work with topics