import { BBSMenu, Thread } from "./";
async function hierarchal() {
const menu = new BBSMenu();
const boards = await menu.fetchBoards();
console.log(boards.names);
const threads = await boards.board("河川・ダム等").fetchThreads();
console.log(threads.titles);
console.log(threads.searchThreads(/なんとか/).map((thread) => thread.title));
const posts = await threads.thread("なんとかスレ").fetchPosts();
const post = posts.post(1);
if (post) {
console.log(post.name);
}
console.log(posts.range(1, 2));
}
async function single() {
const thread = new Thread("http://example.com/foobar/dat/123456789.dat", "title", 42);
const posts = await thread.fetchPosts();
console.log(posts.post(1));
}
hierarchal().then(single);