Sha256: a235d209f8b5347354c2d29c9956db21e02fad7f58c5997331b78c974a43bddc

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require File.expand_path('../../lib/discourse_api', __FILE__)

config = DiscourseApi::ExampleHelper.load_yml

client = DiscourseApi::Client.new(config['host'] || 'http://localhost:3000')
client.api_key = config['api_key'] || "YOUR_API_KEY"
client.api_username = config['api_username'] || "YOUR_USERNAME"

# get latest topics
puts client.latest_topics({})

# recategorize topic
puts client.recategorize_topic(topic_id: 108, category_id: 5)

# get all categories
puts client.categories({})

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
discourse_api-0.45.0 examples/topic_lists.rb
discourse_api-0.44.0 examples/topic_lists.rb
discourse_api-0.43.1 examples/topic_lists.rb
discourse_api-0.43.0 examples/topic_lists.rb
discourse_api-0.42.0 examples/topic_lists.rb
discourse_api-0.41.0 examples/topic_lists.rb
discourse_api-0.40.0 examples/topic_lists.rb
discourse_api-0.39.3 examples/topic_lists.rb
discourse_api-0.39.2 examples/topic_lists.rb
discourse_api-0.39.1 examples/topic_lists.rb
discourse_api-0.39.0 examples/topic_lists.rb