This is a CLI tool that makes request to a Discourse API. This utilizes the [discourse_api](https://github.com/discourse/discourse_api)
gem.
RVM with Ruby 2.3.1 installed.
- Clone the repository.
- Run
bundle install
. - Copy
discourse.env.sample
asdiscourse.env
and set your desiredDISCOURSE_API
andDISCOURSE_API_KEY
variables.
it's easy, just Run bundle exec ruby client.rb
. It accepts the following options:
This can be set by passing -e
or --endpoint
options. This is a required option. Example: -e notifications
or --endpoint notifications
.
This option will be passed to the endpoint specified. It can be a simple string or a JSON string. Example: -p staff
or --params '{"category_slug":"staff"}'
.
This can be set by passing -u
or --username
options. Example: -u patrickbajao
or --username patrickbajao
.
Getting notifications of a user:
$ bundle exec ruby client.rb -e notifications -u patrickbajao
Getting top topics in a category:
$ bundle exec ruby client.rb -e category_top_topics -u patrickbajao -p '{"category_slug":"staff"}'