Walhalla

walhalla.open2ch

OpenThread

Represents a discussion thread on open2ch, including its metadata and all comments. This class is responsible for parsing the cached thread HTML file and converting it into structured data. It also handles storage and retrieval of the parsed content as a JSON file for later use.

titleString

The thread's title (usually derived from the directory name).

numint

The thread's number.

idint

The thread's id.

urlString

The canonical URL of the thread.

commentsListRes

The list of comments (res) contained in this thread.

lastImageBackupedLocalDateTime

getCommentBy(intnum)Res

intnum

The comment number (starting from 1).

Res

The corresponding Res comment.

Retrieves a comment by its number. If the number is negative, it returns the comment counted from the end.

getTopics()ListTopic

ListTopic

A list of extracted Topic objects.

Returns a list of topics extracted from the comments in this thread.

locate()Path

Path

The file path of the persisted thread data.

Specifies where the JSON representation of this thread will be stored.

analyze()void

Performs topic extraction from all comments using an LLM (Gemini).

This method constructs a single prompt string by concatenating all comment bodies and media links, then sends it to a language model to extract high-level discussion topics.

backupImages()void

linkageCharacter()void