Sha256: 5cd8a8e7b147c3aca75de239b7d0274173e3728641140933bd6c93578d237840

Contents?: true

Size: 618 Bytes

Versions: 7

Compression:

Stored size: 618 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({})

# get top topics
puts client.top_topics

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
discourse_api-1.1.0 examples/topic_lists.rb
discourse_api-1.0.0 examples/topic_lists.rb
discourse_api-0.48.1 examples/topic_lists.rb
discourse_api-0.48.0 examples/topic_lists.rb
discourse_api-0.47.0 examples/topic_lists.rb
discourse_api-0.46.0 examples/topic_lists.rb
discourse_api-0.45.1 examples/topic_lists.rb