2ch-fetcher
2ch fetcher
Last updated 2 years ago by narazaka .
MIT · Original npm · Tarball · package.json
$ cnpm install 2ch-fetcher 
SYNC missed versions from official npm registry.

2ch-fetcher

FOSSA Status

2ch fetcher

Install

npm install 2ch-fetcher

Usage

import { BBSMenu, Thread } from "./";

async function hierarchal() {
    const menu = new BBSMenu(); // default url is bbsmenu of 2ch.sc
    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); // 1 origin
    if (post) { // あぼーん post is undefined
        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);

License

This is released under MIT License

FOSSA Status

Current Tags

  • 2.3.0                                ...           latest (2 years ago)

11 Versions

  • 2.3.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 49
Last Day 0
Last Week 13
Last Month 23
Dependencies (6)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |