Sha256: ca9d4d1d0cff6acad92b89eaf82eca13088621f3470ac00fcfe2c972593fcd5c

Contents?: true

Size: 489 Bytes

Versions: 4

Compression:

Stored size: 489 Bytes

Contents

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

client = DiscourseApi::Client.new("http://localhost:3000")
client.api_key = "YOUR_API_KEY"
client.api_username = "YOUR_USERNAME"

# get all dashboard status as json
puts client.get_dashboard_stats

# get hash of some dashboard total value
puts client.get_dashboard_stats_totals
# sample output: {"users"=>9, "topics"=>230, "posts"=>441}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
discourse_api-0.38.0 examples/dashboard.rb
discourse_api-0.37.0 examples/dashboard.rb
discourse_api-0.36.0 examples/dashboard.rb
discourse_api-0.35.0 examples/dashboard.rb