npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

manytoon.com

v1.1.0

Published

Simply parser for manytoon.com

Downloads

29

Readme

Simple parser for Manytoon.

Installation

$ npm install manytoon.com

Usage

Require a library and... just use

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function testParser() {
    const girlPage = await parser.search('Girl')
    console.log(girlPage) //Returns a 60 doujins on page

    const simplePage = await parser.getHomepage()
    console.log(simplePage)

    const firstDoujin = simplePage[0]
    console.log(firstDoujin)

    const doujin = await parser.getDoujin('https://manytoon.com/comic/gu-hos-escape-mnt0015/')
    console.log(doujin);
}
testParser()

Classes

Parser

constructor()

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | ------- | | None | any | None | false |

Methods

.getDoujin(url)

Getting a doujin from manytoon.com URL | Parameter | Type | Description | Required | | --------- | ------------------------------------------------------------------------------------------------- | ------------------------ | -------- | | url | string | URL for getting a doujin | true |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logDoujin() {
    const doujin = await parser.getDoujin()
    console.log(doujin)
}
logDoujin()

Returns: Promise<Doujin>

.getHomepage()

Get the homepage

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logHome() {
    const page = await parser.getHomepage()
    console.log(page)
}
logHome()

Returns: Promise<Page<Doujin>>

.search(target)

Do search doujins from name

| Parameter | Type | Description | Required | | --------- | ------------------------------------------------------------------------------------------------- | ------------------ | -------- | | target | string | Name for searching | true |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logFound() {
    const page = await parser.search('girl')
    console.log(page)
}
logFound()

Returns: Promise<Page<Doujin>>


Page

constructor(options)

| Parameter | Type | Description | Required | | ---------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------- | -------- | | options | object | Options for creating page | true | | options.html | string | HTML text | true | | options.isHome | boolean | Is homepage or not | true | | options.lastPage | number | Number of last page | true | | options.target | string | Search target | false | | options.doujins | Array<Doujin> | Doujins' Array | true |

Methods

.to(page)

Returns the page by its number

| Parameter | Type | Description | Required | | ---------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------- | -------- | | page | number | Page number | true |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logPage() {
    const page = await parser.getHomepage()
    console.log(await page.to(4))
}
logPage()

Returns: Promise<Page<Doujin>>

.next()

Returns the next page

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function loSecondgPage() {
    const page = await parser.getHomepage()
    console.log(await page.next())
}
logSecondPage()

Returns: Promise<Page<Doujin>>

.prev()

Returns the previous page

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function loSecondgPage() {
    const page = await parser.getHomepage()
    const threerdPage = await page.to(3)
    console.log(threerdPage.prev())
}
logSecondPage()

Returns: Promise<Page<Doujin>>

.getCurrentPageNumber()

Returns the current page

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logSecondgPage() {
    const page = await parser.getHomepage()
    const secondPage = await page.next()
    console.log(secondPage.getCurrentPageNumber())
}
logSecondPage()

Returns: number

.getLastPageNumber()

Returns the current page

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logLastPageNumber() {
    const page = await parser.getHomepage()
    console.log(secondPage.getLastPage())
}
logLastPageNumber()

Returns: number


Doujin

constructor(html, url, statusCode)

| Parameter | Type | Description | Required | | ---------- | ------------------------------------------------------------------------------------------------- | ----------- | ------- | | html | string | None | true | | url | string | None | true | | statusCode | number | None | true |

Properties

const statusCode: number;
const name: string;
const rating: string;
const totalVotes: string;
const rank: string;
const montlyViews: string;
const status: string;
const releaseYear: string;
const genres: string[];
const url: string;
const img: string;

Methods

.getAllChapters()

Returns all chapters

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logAllChapters() {
    const page = await parser.getHomepage()
    console.log(await parser[0].getAllChapters())
}
logAllChapters()

Returns: Array<string>

.getLastChapter()

Getting a last chapter

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logLastChapter() {
    const page = await parser.getHomepage()
    console.log(await parser[0].getLastChapter())
}
logLastChapter()

Returns: string

.getFirstChapter()

Getting a last chapter

| Parameter | Type | Description | Required | | --------- | ------ | ----------- | -------- | | None | any | None | false |

Example:

const Manytoon = require('manytoon.com')
const parser = new Manytoon.Parser() 

async function logFirstChapter() {
    const page = await parser.getHomepage()
    console.log(await parser[0].getFirstChapter())
}
logFirstChapter()

Returns: string


Support

Discord Server


License

MIT License

Copyright © Crafting1i