Skip to content

mekostin/smflib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smflib

Simple Elixir library for working with SMF(v2.0.15) forum: Opportunities:

  • create a new topic with new initial message
  • add message to particular topic
  • lock and move the topic to archive branch of forum

Installation

If available in Hex, the package can be installed by adding smflib to your list of dependencies in mix.exs:

def deps do
  [
    {:smflib, "~> 0.1.0"}
  ]
end

Examples

Add new forum topic with message

Smflib.authorize(url, user, password)
  |> Smflib.Post.new(board_id, subject, message)

Update the topic with an additional message

Smflib.authorize(url, user, password)
  |> Smflib.Post.update(board_id, subject, add_message)

Lock and move topic to archive

Smflib.authorize(url, user, password)
  |> Smflib.Post.archive(board_id, subject, add_message)

Full example

SMF requires to make a delay between forum posting actions. Function sleep_between_actions is realized this requirements.

Smflib.authorize(url, user, password)
  |> Smflib.Post.new(board_id, subject, message)
  |> sleep_between_actions
  |> Smflib.Post.update(add_message)
  |> sleep_between_actions
  |> Smflib.Post.archive(archive_id)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages