Sha256: 1edabdfea15bb06271c43c00f96be3c8d6655bef6d0b087230cd3a6a35705c6e

Contents?: true

Size: 656 Bytes

Versions: 30

Compression:

Stored size: 656 Bytes

Contents

$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"

# Post Action Type IDs
# 1 - Bookmark
# 2 - Like
# 3 - Flag: Off-topic
# 4 - Flag: Inappropriate
# 5 - Vote
# 6 - Notify User
# 7 - Flag - Notify Moderators
# 8 - Flag - Spam

# Like a post
client.create_post_action(id: 2, post_action_type_id: 2)

# Flag a topic as spam
client.create_topic_action(id: 1, post_action_type_id: 8)

# Unlike a post
client.destroy_post_action(id: 3, post_action_type_id: 2)

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
discourse_api-0.34.0 examples/post_action.rb
discourse_api-0.33.0 examples/post_action.rb
discourse_api-0.32.0 examples/post_action.rb
discourse_api-0.31.0 examples/post_action.rb
discourse_api-0.30.0 examples/post_action.rb
discourse_api-0.29.0 examples/post_action.rb
discourse_api-0.28.1 examples/post_action.rb
discourse_api-0.28.0 examples/post_action.rb
discourse_api-0.27.0 examples/post_action.rb
discourse_api-0.26.0 examples/post_action.rb
discourse_api-0.25.0 examples/post_action.rb
discourse_api-0.24.0 examples/post_action.rb
discourse_api-0.23.1 examples/post_action.rb
discourse_api-0.23.0 examples/post_action.rb
discourse_api-0.22.0 examples/post_action.rb
discourse_api-0.20.1 examples/post_action.rb
discourse_api-0.20.0 examples/post_action.rb
discourse_api-0.19.0 examples/post_action.rb
discourse_api-0.18.0 examples/post_action.rb
discourse_api-0.17.0 examples/post_action.rb