fourchan

package
v0.0.0-...-c94f36e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2014 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hello = bbs.HelloMessage{
	Command:         "hello",
	Name:            "Fourchan relay",
	ProtocolVersion: 0,
	Description:     "4chan -> BBS Relay",
	Options:         []string{"imageboard", "readonly", "boards"},
	Access: bbs.AccessInfo{

		GuestCommands: []string{"hello", "get", "list"},
	},
	Formats:       []string{"html", "text"},
	Lists:         []string{"thread", "board"},
	ServerVersion: "4chan-relay 0.1",
}

Functions

func New

func New() bbs.BBS

func Setup

func Setup(name, desc, realtimePath string)

Types

type Board

type Board struct {
	ID       string `json:"board"`
	Name     string `json:"title"`
	Worksafe int    `json:"ws_board"`
}

func (Board) String

func (b Board) String() string

type Boards

type Boards struct {
	List []*Board `json:"boards"`
}

type Catalog

type Catalog []Page

type Fourchan

type Fourchan struct {
}

func (*Fourchan) BoardList

func (f *Fourchan) BoardList(m bbs.ListCommand) (blm bbs.BoardListMessage, err error)

func (*Fourchan) Get

func (f *Fourchan) Get(m bbs.GetCommand) (tm bbs.ThreadMessage, err error)

func (*Fourchan) Hello

func (f *Fourchan) Hello() bbs.HelloMessage

func (*Fourchan) IsLoggedIn

func (f *Fourchan) IsLoggedIn() bool

func (*Fourchan) List

func (f *Fourchan) List(m bbs.ListCommand) (lm bbs.ListMessage, err error)

func (*Fourchan) LogIn

func (f *Fourchan) LogIn(m bbs.LoginCommand) bool

func (*Fourchan) LogOut

func (f *Fourchan) LogOut(m bbs.LogoutCommand) bbs.OKMessage

func (*Fourchan) Post

func (f *Fourchan) Post(m bbs.PostCommand) (pm bbs.OKMessage, err error)

func (*Fourchan) Register

func (f *Fourchan) Register(m bbs.RegisterCommand) (okm bbs.OKMessage, err error)

func (*Fourchan) Reply

func (f *Fourchan) Reply(m bbs.ReplyCommand) (ok bbs.OKMessage, err error)

type FourchanPost

type FourchanPost struct {
	Number        int    `json:"no"`
	ReplyTo       int    `json:"resto"`
	Sticky        int    `json:"sticky,omitempty"`
	Closed        int    `json:"closed,omitempty"`
	Date          string `json:"now"`
	Timestamp     int    `json:"time"`
	Name          string `json:"name,omitempty"` //username
	Tripcode      string `json:"trip,omitempty"`
	ID            string `json:"id,omitempty"` //user ID
	Capcode       string `json:"capcode,omitempty"`
	CountryName   string `json:"country_name,omitempty"`
	Email         string `json:"email,omitempty"`
	Subject       string `json:"sub,omitempty"`
	Text          string `json:"com,omitempty"` //HTML
	FileTime      uint64 `json:"tim,omitempty"`
	FileExt       string `json:"ext,omitempty"`
	FileDeleted   int    `json:"filedeleted,omitempty"`
	Spoiler       int    `json:"spoiler,omitempty"`
	OmitedPosts   int    `json:"omitted_posts,omitempty"`
	OmittedImages int    `json:"omitted_images,omitempty"`
	Replies       int    `json:"replies,omitempty"`
	Images        int    `json:"images,omitempty"`
}

type Page

type Page struct {
	Number  int             `json:"page"`
	Threads []*FourchanPost `json:"threads"`
}

type Thread

type Thread struct {
	Posts []*FourchanPost `json:"posts"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL