Socket
Book a DemoInstallSign in
Socket

wtforum

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wtforum

0.8.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

WTForum

Ruby library that wraps Website Toolbox's Forum API.

Useful for folks looking to embed the forum into their site, while maintaining a user-facing appearance of a single user account.

Installation

Add this line to your application's Gemfile:

gem 'wtforum'

And then execute:

$ bundle

Or install it yourself as:

$ gem install wtforum

Features

WTForum has the following features:

CRUD user accounts

# Modeled after ActiveRecord API

# Create
user = WTForum::User.create username: "wtforum_test_user", email: "wtforum_test_user@example.com"

# Read
WTForum::User.count
user = WTForum::User.find(user.id)
user = WTForum::User.find_by_username(user.username)

# Update
user.update_attributes! username: "wtforum_test_user_2", email: "wtforum_test_user_2@example.com"

# Destroy
WTForum::User.destroy(user.id)
user.destroy

Log in your user via their Single Sign On (SSO) API

session = WTForum::Session.create(user.id)
session.token # => REiB6U5SkxB

Configuration

Before using WTForum, you need to give it administrator credentials. It needs four pieces of information:

  • Where the forum is hosted.
  • The API key that Website Toolbox provides.
  • Username of an admin account.
  • Password for said admin account.

Example Rails config:

# config/initializers/wtforum_credentials.rb
WTForum.domain = "forum.example.com"
WTForum.api_key = "TEgPYR4Zapz"
WTForum.admin_username = "__admin_api_dont_delete__"
WTForum.admin_password = "s0m3p4ssw0rd"

Why do we need to specify an admin user account in the credentials?

Unfortunately, Website Toolbox's Forum API is missing some functionality. Specifically, you can only create a new forum user account. Need to read, update, or delete an existing user via the API? You're out of luck! As a workaround, this library uses an admin account and Mechanize to sign into the website and manually fill out forms and screenscrape the results. I hope that the API's breadth of functionality improves in the future.

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 01 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.