tofu

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

README

Tofu - Thread watcher for Sriracha imageboards and forums

Donate

Features

  • Subscribe to Sriracha boards, threads and mentions >>###
  • Specify page refresh interval
  • Receive desktop notifications

Install

Download

Download Tofu

Build

Install the Go compiler and run the following command:

go install codeberg.org/tslocum/tofu/cmd/tofu@latest

Tofu will then be available at ~/go/bin/tofu.

Documentation

Press E or F2 to add a note.

Press R or F5 to manually refresh all subscriptions.

Press Delete to remove a subscription.

Subscriptions are refreshed every five minutes by default. Pass --interval to specify a custom interval (in minutes).

When refreshing, pages are requested every five seconds by default. Pass --delay to specify a custom delay (in seconds).

If you are using Linux, you must install notify-send to receive desktop notifications.

When using a terminal-based web browser such as Lynx, pass --pause to enable integration:

tofu --browser lynx --pause
Mod queue support

Tofu supports monitoring Sriracha mod queue status pages. Paste a mod queue URL including the .html suffix to subscribe.

What about Android/iPhone?

Sriracha supports sending browser notifications whenever board index or thread pages are updated since v1.9.6.

Open any relevant index or thread pages on your mobile device and enable browser notifications by tapping the speech bubble icon.

Notifications only need to be enabled once, then any newly opened index or thread page will show notifications.

Support

  1. Ensure you are running the latest version of Tofu.
  2. Review the open issues.
  3. Open a new issue.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheDir string
View Source
var Version = "0.0.0"

Functions

func LoadSubscriptions

func LoadSubscriptions()

func ParseThread

func ParseThread(baseURL string, threadID int, mentionID int) (*threadInfo, error)

func RefreshSubscription

func RefreshSubscription(delay time.Duration, notifications chan *Notification, sub ...*Subscription)

func RefreshSubscriptions

func RefreshSubscriptions(delay time.Duration, notifications chan *Notification)

func Subscribe

func Subscribe(s *Subscription)

func Summarize

func Summarize(notifications []*Notification) string

func Unsubscribe

func Unsubscribe(s *Subscription)

Types

type Notification

type Notification struct {
	Type   NotificationType
	Sub    *Subscription
	Thread int
	Post   int
	Mod    bool
}

type NotificationType

type NotificationType int
const (
	TypeThread  NotificationType = 0
	TypeReply   NotificationType = 1
	TypeMention NotificationType = 2
)

type Post

type Post struct {
	ID           int
	Parent       int
	Timestamp    int64
	Bumped       int64
	IP           string
	Name         string
	Tripcode     string
	Email        string
	NameBlock    string
	Subject      string
	Message      string
	Password     string
	File         string
	FileMIME     string
	FileHash     string
	FileOriginal string
	FileSize     int64
	FileWidth    int
	FileHeight   int
	Thumb        string
	ThumbWidth   int
	ThumbHeight  int
	Stickied     bool
	Locked       bool
}

type Subscription

type Subscription struct {
	Website string
	Thread  int
	Post    int
	Last    int // Last post ID to mention the subscribed post, or last post in thread.
	Mention bool
	Note    string
	Checked time.Time
	Updated time.Time
	Status  int
}

func ParseURL

func ParseURL(u string) (*Subscription, error)

func Subscriptions

func Subscriptions() []*Subscription

func (*Subscription) SetNote added in v1.0.6

func (s *Subscription) SetNote(note string)

func (*Subscription) URL

func (s *Subscription) URL(postID int) string

Directories

Path Synopsis
cmd
tofu command

Jump to

Keyboard shortcuts

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